Friday, September 19, 2014

Functions - C++

1. 
Which of the following statement is correct?
A.Constructors can have default parameters.
B.Constructors cannot have default parameters.
C.Constructors cannot have more than one default parameter.
D.Constructors can have at most five default parameters.
2. 
Which of the following function / type of function cannot be overloaded?
A.Member function
B.Static function
C.Virtual function
D.Both B and C
3. 
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.
4. 
Where the default value of parameter have to be specified?
A.Function call
B.Function definition
C.Function prototype
D.Both B or C
5. 
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.
6. 
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.

No comments: