C++ MCQ Questions and Answers
C++ MCQ questions and answers are vital for students preparing for software development and IT placement exams like TCS, Infosys, and Tech Mahindra. These questions test your understanding of core concepts such as classes, objects, inheritance, polymorphism, and templates. Practicing C++ programming MCQs with detailed explanations helps strengthen coding logic and syntax understanding. This topic is ideal for candidates aiming to improve their performance in programming interview questions with answers and campus recruitment tests.
C++ MCQ
Showing 10 of
93 questions
91. Observe following function declaration and choose the best answer: int divide ( int a, int b = 2 )
- Variable b is of integer type and will always have value 2
- Variable a and b are of int type and the initial value of both variables is 2
- Variable b is international scope and will have value 2
- Variable b will have value 2 if not specified when calling function
92. The keyword endl
- Ends the execution of program where it is written
- Ends the output in cout statement
- Ends the line in program. There can be no statements after endl
- Ends current line and starts a new line in cout statement.
93. Strings are character arrays. The last index of it contains the null-terminated character
- \n
- \t
- \0
- \1