Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Functions

Cpp Programming Quiz 174 – Which of the following function / types of function cannot have default parameters?

Question: Which of the following function / types of function cannot have default parameters?
[A].Member function of class
[B].main()[C].Member function of structure
[D].Both B and C

Answer: Option B

Cpp Programming Quiz 174 – Which of the following function / types of function cannot have default parameters? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 176 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A]. Only one parameter of a function can be a default parameter.
[B]. Minimum one parameter of a function must be a default parameter.[C]. All the parameters of a function can be default parameters.
[D]. No parameter of a function can be default.

Answer: Option C

Cpp Programming Quiz 176 – Which of the following statement is correct? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 177 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A]. The order of the default argument will be right to left.
[B]. The order of the default argument will be left to right.[C]. The order of the default argument will be alternate.
[D]. The order of the default argument will be random.

Answer: Option A

Cpp Programming Quiz 177 – Which of the following statement is correct? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 178 – Which of the following statement is incorrect?

Question: Which of the following statement is incorrect?
[A]. Default arguments can be provided for pointers to functions.
[B]. A function can have all its arguments as default.[C]. Default argument cannot be provided for pointers to functions.
[D]. A default argument cannot be redefined in later declaration.

Answer: Option C

Cpp Programming Quiz 178 – Which of the following statement is incorrect? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 180 – Which of the following statement is incorrect?

Question: Which of the following statement is incorrect?
[A]. A default argument is checked for type at the time of declaration and evaluated at the time of call.
[B]. We can provide a default value to a particular argument in the middle of an argument list.[C]. We cannot provide a default value to a particular argument in the middle of an argument list.
[D]. Default arguments are useful in situations where some arguments always have the same value.

Answer: Option B

Cpp Programming Quiz 180 – Which of the following statement is incorrect? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 181 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A]. The default value for an argument cannot be function call.
[B]. C++ allows the redefinition of a default parameter.[C]. Both A and B.
[D]. C++ does not allow the redefinition of a default parameter.

Answer: Option D

 

Cpp Programming Quiz 181 – Which of the following statement is correct? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 182 – Which of the following function prototype is perfectly acceptable?

Question: Which of the following function prototype is perfectly acceptable?
[A]. int Function(int Tmp = Show());
[B]. float Function(int Tmp = Show(int, float));[C]. Both A and B.
[D]. float = Show(int, float) Function(Tmp);

Answer: Option A

 

Cpp Programming Quiz 182 – Which of the following function prototype is perfectly acceptable? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 183 – Which of the following statement is incorrect?

Question: Which of the following statement is incorrect?
[A]. The default value for an argument can be a global constant.
[B]. The default arguments are given in the function prototype.[C]. Compiler uses the prototype information to build a call, not the function definition.
[D]. The default arguments are given in the function prototype and should be repeated in the function definition.

Answer: Option D

Cpp Programming Quiz 183 – Which of the following statement is incorrect? Read More »

Cpp Programming, Functions