closepop
closepop

Would you like to submit the test?


C++ :

Functions




1.
Which of the following function prototype is perfectly acceptable?

int Function(int Tmp = Show());
float Function(int Tmp = Show(int, float));
Both A and B.
float = Show(int, float) Function(Tmp);




2.
Which of the following statement is correct?

Overloaded functions can have at most one default argument.
An overloaded function cannot have default argument.
All arguments of an overloaded function can be default.
A function if overloaded more than once cannot have default argument.




3.
Which of the following statement is correct?

Two functions having same number of argument, order and type of argument can be overloaded if both functions do not have any default argument.
Overloaded function must have default arguments.
Overloaded function must have default arguments starting from the left of argument list.
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?

The trailing argument will be the default argument.
The first argument will be the default argument.
The middle argument will be the default argument.
All the argument will be the default argument.




5.
Which of the following statement is incorrect?

Default arguments can be provided for pointers to functions.
A function can have all its arguments as default.
Default argument cannot be provided for pointers to functions.
A default argument cannot be redefined in later declaration.




6.
Which of the following statement is correct?

Constructors can have default parameters.
Constructors cannot have default parameters.
Constructors cannot have more than one default parameter.
Constructors can have at most five default parameters.




7.
Which of the following function / type of function cannot be overloaded?

Member function
Static function
Virtual function
Both B and C




8.
Which of the following function declaration is/are incorrect?

int Sum(int a, int b = 2, int c = 3);
int Sum(int a = 5, int b);
int Sum(int a = 0, int b, int c = 3);
Both B and C are incorrect.




9.
Where the default value of parameter have to be specified?

Function call
Function definition
Function prototype
Both B or C




10.
Which of the following statement is correct?

The default value for an argument cannot be function call.
C++ allows the redefinition of a default parameter.
Both A and B.
C++ does not allow the redefinition of a default parameter.




11.
Which of the following statement is correct?

Only one parameter of a function can be a default parameter.
Minimum one parameter of a function must be a default parameter.
All the parameters of a function can be default parameters.
No parameter of a function can be default.




12.
Which of the following statement is incorrect?

A default argument is checked for type at the time of declaration and evaluated at the time of call.
We can provide a default value to a particular argument in the middle of an argument list.
We cannot provide a default value to a particular argument in the middle of an argument list.
Default arguments are useful in situations where some arguments always have the same value.




13.
Which of the following statement is correct?

Overloaded functions can accept same number of arguments.
Overloaded functions always return value of same data type.
Overloaded functions can accept only same number and same type of arguments
none of the above










FreshersLive - No.1 Job site in India. Here you can find latest 2016 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.


FreshersLive - No.1 Job site in India. Here you can find latest 2016 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.