Saturday, September 20, 2014

Functions - C++

1. 
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.
2. 
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.
3. 
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
4. 
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.
5. 
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);

No comments: