728by90ad
Functions Questions And Answers.
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); |
|
|
Published by:Michael Daani
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. |
|
|
Published by:Michael Daani
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. |
|
|
Published by:Michael Daani
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. |
|
|
Published by:Michael Daani
5. | What will be the output of the program? |
|
#include<iostream.h>
long PAKFunction(int x, int y = 5, float z = 5)
{
return(++x * ++y + (int)++z);
}
int main()
{
cout<< PAKFunction(20, 10);
return 0;
}
|
| A. | 237 |
| B. | 242 |
| C. | 240 |
| D. | 35 |
|
|
Published by:Michael Daani