# C/C /C Programming - Functions Sample Test,Sample questions

## Question: ``` Which of the following function / type of function cannot be overloaded?```

1.Member function

2.Static function

3.Virtual function

4.Both B and C

Posted Date:-2021-02-24 09:39:07

## Question: ``` Which of the following statement is incorrect?```

1.A default argument is checked for type at the time of declaration and evaluated at the time of call.

2.We can provide a default value to a particular argument in the middle of an argument list.

3.We cannot provide a default value to a particular argument in the middle of an argument list.

4.Default arguments are useful in situations where some arguments always have the same value.

Posted Date:-2021-02-24 09:39:07

## Question: `ï»¿Which of the following function prototype is perfectly acceptable?`

1.int Function(int Tmp = Show());

2.float Function(int Tmp = Show(int, float));

3.Both A and B.

4.float = Show(int, float) Function(Tmp);

Posted Date:-2021-02-24 09:39:07

## Question: `Where the default value of parameter have to be specified?`

1.Function call

2.Function definition

3.Function prototype

4.Both B or C

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following function / types of function cannot have default parameters?`

1.Member function of class

2.main()

3.Member function of structure

4.Both B and C

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following function declaration is/are incorrect?`

1.int Sum(int a, int b = 2, int c = 3);

2. int Sum(int a = 5, int b);

3. int Sum(int a = 0, int b, int c = 3);

4.. Both B and C are incorrect.

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following statement is correct?`

1. C++ enables to define functions that take constants as an argument.

2.We cannot change the argument of the function that that are declared as constant.

3.Both A and B.

4. We cannot use the constant while defining the function.

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following statement is correct?`

1. Overloaded functions can have at most one default argument.

2.An overloaded function cannot have default argument.

3.All arguments of an overloaded function can be default.

4. A function if overloaded more than once cannot have default argument.

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following statement is correct?`

1.Two functions having same number of argument, order and type of argument can be overloaded if both functions do not have any default argument.

2.Overloaded function must have default arguments.

3.Overloaded function must have default arguments starting from the left of argument list.

4. A function can be overloaded more than once.

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following statement is correct?`

1.Constructors can have default parameters.

2.Constructors cannot have default parameters.

3. Constructors cannot have more than one default parameter.

4. Constructors can have at most five default parameters.

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following statement is correct?`

1.Only one parameter of a function can be a default parameter.

2.Minimum one parameter of a function must be a default parameter.

3.All the parameters of a function can be default parameters.

4.No parameter of a function can be default.

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following statement is correct?`

1.Overloaded functions can accept same number of arguments.

2.Overloaded functions always return value of same data type.

3.Overloaded functions can accept only same number and same type of arguments.

4.Overloaded functions can accept only different number and different type of arguments.

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following statement is correct?`

1.The order of the default argument will be right to left.

2.The order of the default argument will be left to right.

3.The order of the default argument will be alternate.

4.The order of the default argument will be random.

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following statement is incorrect?`

1.Default arguments can be provided for pointers to functions.

2.A function can have all its arguments as default.

3.Default argument cannot be provided for pointers to functions.

4.A default argument cannot be redefined in later declaration.

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following statement is incorrect?`

1.The default value for an argument can be a global constant.

2.. The default arguments are given in the function prototype.

3. Compiler uses the prototype information to build a call, not the function definition.

4.The default arguments are given in the function prototype and should be repeated in the function definition.

Posted Date:-2021-02-24 09:39:07

## Question: `Which of the following statement will be correct if the function has three arguments passed to it?`

1.The trailing argument will be the default argument.

2.The first argument will be the default argument.

3.The middle argument will be the default argument.

4.All the argument will be the default argument.

Posted Date:-2021-02-24 09:39:07

## More MCQS

##### R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!