Object Oriented Programming - Functions

1. Choose the correct statements regarding inline functions.

  • Option : D
  • Explanation : Each occurrence of the iriline function call will be replaced by its body. No function call overhead will be there but the size of the code will increase.
Cancel reply
Cancel reply

3. A function abc is defined as
void abc(int x=0, int y, int z=0)

cout << x  << y << z;

Which of the following function calls is/are illegal? (Assume h, g are declared as integers) 

  • Option : D
  • Explanation : Since the second argument is mandatory, any call should have at least the first two parameters. Some compilers expect the optional parameters to follow the others. Such compilers give a compilation error.
Cancel reply
Cancel reply

5. int a =1 , b=2;

a=chg(b) ;

cout << a << b ;

If the function chg is coded as

int chg(int x)
x = 10;

return ();


  • Option : C
  • Explanation : Here the default parameter passing mechanism of pass by value will be used. Any change done to the parameter will not be reflected outside the function. So, b retains its value 2.
Cancel reply
Cancel reply
  • Functions Questions can be used to give quizzes by any candidate who is preparing for UGC NET Computer Science
  • This Functions Questions section will help you test your analytical skills in a tricky method, thereby giving you an edge over other students
  • Any student who wants to prepare for DOEACC A Level, DOEACC B Level, and DOEACC C level can also use these Objective Type Questions Answer.
  • All candidates who have to appear for the Kendriya Vidyalaya Entrance exam can also refer to this mcq section.
  • You can also get access to the Functions MCQ ebook.
  • Functions Questions can be used in the preparation of JRF, CSIR, and various other exams.
  • You can also download pdf for these Functions multiple-choice questions Answers.
  • This Functions Multiple Choice Questions Answers section can also be used for the preparation of various competitive exams like UGC NET, GATE, PSU, IES, and many more.
  • Functions Questions can be used to gain a credit score in various undergraduate and postgraduate courses like BSc, MSc and MCA
  • Functions Questions for UGC NET Computer Science

    Functions MCQ

    Functions Multiple choice questions