General Questions

Question 1 :

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

Question 2 :

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.
Answer : Option C

Question 3 :

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.
Answer : Option C

Question 4 :

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.
Answer : Option D

Question 5 :

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.
Answer : Option A