C++ MCQ Question and Answer
C++ MCQ Question and Answer
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. ==