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

  1. C++ Programming MCQS Set-1
  2. C++ Multiple Choice Questions Set-1
  3. C++ Multiple Choice Questions Set-2
  4. C++ Programming MCQS Set-2
  5. C++ Programming MCQS Set-3
  6. C++ Programming MCQS Set-4
  7. C++ (CPP) MCQ Question with Answer
  8. Advanced c++ multiple choice question(MCQS)
  9. OOPS Quiz Questions and Answers(MCQS)
  10. C Programming - MCQ Questions Set 1
  11. C Programming - MCQ Questions Set 2
  12. C Programming - MCQ Questions Set 3
  13. C Programming - MCQ Questions Set 4
  14. C Programming - MCQ Questions Set 5
  15. C++ programming language MCQ Questions Set 1
  16. C++ programming language MCQ Questions Set 2
  17. C++ programming language MCQ Questions Set 3
  18. C++ programming language MCQ Questions Set 4
  19. C++ programming language MCQ Questions Set 5
  20. C++ Programming -Constructors and Destructors
  21. C++ Programming -OOPS Concepts
  22. C++ Programming - References
  23. C++ Programming - Functions
  24. C MCQS:-The ABC of C
  25. C MCQS Interview Questions
  26. C++ Questions and Answers OOPs Basic Concepts
  27. C++ Questions and Answers Returning Objects
  28. C Programming MCQ Part 1
  29. C Programming MCQ
  30. Computer Science & Engineering C Multiple Choice Questions set 1
  31. Computer Science & Engineering C Multiple Choice Questions set 2
  32. C Multiple Choice Questions C Functions Set 1
  33. C Multiple Choice Questions C Functions Set 2
  34. C Multiple Choice Questions C Operators
  35. C Multiple Choice Questions & AnswersConditional Expressions
  36. C Multiple Choice Questions & Answers Data Types
  37. C Multiple Choice Questions & Answers File Access
  38. Computer Science & Engineering Cloud Computing MCQs Part 1
  39. CPP Programming MCQ Set 1
  40. CPP Programming MCQ Set 2
Search
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!