Thursday, September 18, 2014

Functions - C++

1. 
Which of the following statement is correct?
A.C++ enables to define functions that take constants as an argument.
B.We cannot change the argument of the function that that are declared as constant.
C.Both A and B.
D.We cannot use the constant while defining the function.
2. 
Which of the following statement is correct?
A.Overloaded functions can have at most one default argument.
B.An overloaded function cannot have default argument.
C.All arguments of an overloaded function can be default.
D.A function if overloaded more than once cannot have default argument.
3. 
Which of the following statement is correct?
A.Two functions having same number of argument, order and type of argument can be overloaded if both functions do not have any default argument.
B.Overloaded function must have default arguments.
C.Overloaded function must have default arguments starting from the left of argument list.
D.A function can be overloaded more than once.
4. 
Which of the following statement will be correct if the function has three arguments passed to it?
A.The trailing argument will be the default argument.
B.The first argument will be the default argument.
C.The middle argument will be the default argument.
D.All the argument will be the default argument.
5. 
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.

No comments: