C++ Functions Questions and Answers, C++ Programming MCQ on Functions

C++ Functions Multiple Choice Questions with Answers. Following questions of C++ Programming Section are related to C++ Functions Topic. Each question have 4 options with 1 correct answer. For More C++ Programming Questions and Answers visit C++ Programming .

1) The signature of a function is its ..... ?
  1. Function code
  2. Prototype
  3. Call
  4. Parameter list
Show Answer
Answer = Prototype
2) What is true about inline functions ?
  1. It's a compulsion on the compiler to make function inline
  2. It's a request to the compiler to make te function inline
  3. It's the indication to the compiler that the function is recursive
  4. It's the indication to the compiler that the function is member function
Show Answer
Answer = It's a request to the compiler to make te function inline
3) Which member function of class cannot modify its objects attributes ?
  1. friend functions
  2. Private member functions
  3. Constant member functions
  4. Static member functions
Show Answer
Answer = Constant member functions
4) Which of the following parameter passing mechanism is/are supported by C++ but not in C?
  1. Pass by value
  2. Pass by reference
  3. Pass by value result
  4. All of the above
Show Answer
Answer = Pass by reference
5) Which of the following type of function is an ideal candidate for being declared inline ?
  1. A function that is small and is not called frequently
  2. A function that is small and is called frequently
  3. A function that is not small and is not called frequently
  4. A function that is not small and is called frequently
Show Answer
Answer = A function that is small and is called frequently
6) One of the disadvantage of pass by reference is that the called function may inadvertently corrupt the called data.This is avoided by ?
  1. passing pointers
  2. declaring the formal parameters constant
  3. declaring the actual parameters constant
  4. all of above
Show Answer
Answer = declaring the formal parameters constant
7) The library function exit() causes an exit from ?
  1. The loop in which it occurs
  2. The block in which it occurs
  3. The function in which it occurs
  4. The program in which it occurs
Show Answer
Answer = The program in which it occurs
8) The getche() library function
  1. returns a character when any key is pressed
  2. returns a character when ENTER is pressed
  3. displays a character on the screen when any key is pressed
  4. does not display a character on the screen
Show Answer
Answer = returns a character when any key is pressed
9) When an argument is passed by reference
  1. a variable is created in function to hold the argument value
  2. the function cannot access the argument value
  3. a temporary variable is created in the calling program to hold arguments value
  4. None of these
Show Answer
Answer = a variable is created in function to hold the argument value
10) Overloaded function
  1. are a group of functions,with the same value
  2. all have the same number and types of arguments
  3. make life simpler for programmers
  4. may fail unexpectedly due to stress
Show Answer
Answer = make life simpler for programmers

For More Questions visit Here -


Do You Like This? Please take 5 seconds to share with your firends.