C++ Programming - Functions

Exercise :: Functions - General Questions

11. 

Where the default value of parameter have to be specified?

A. Function call
B. Function definition
C. Function prototype
D. Both B or C

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

12. 

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

Explanation:

No answer description available for this question. Let us discuss.

13. 

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

Explanation:

No answer description available for this question. Let us discuss.

14. 

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

Explanation:

No answer description available for this question. Let us discuss.

15. 

Which of the following statement is correct?

A. Overloaded functions can accept same number of arguments.
B. Overloaded functions always return value of same data type.
C. Overloaded functions can accept only same number and same type of arguments.
D. Overloaded functions can accept only different number and different type of arguments.

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.