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
2. What is the correct value to return to the operating system upon the successful completion of a program?
- -1
- 1
- 0
- Programs do not return a value.
3. What is the only function all C++ programs must contain?
- start()
- system()
- main()
- program()
4. What punctuation is used to signal the beginning and end of code blocks?
- { }
- -> and <-
- BEGIN and END
- ( and )
5. What punctuation ends most lines of C++ code?
- . (dot)
- ; (semi-colon)
- : (colon)
- ' (single quote)
6. Which of the following is a correct comment?
- */ Comments */
- ** Comment **
- /* Comment */
- { Comment }
7. Which of the following is a correct comment?
- */ Comments */
- ** Comment **
- /* Comment */
- { Comment }
9. Which of the following is the correct operator to compare two variables?
- A. :=
- B. =
- C. equal
- D. ==