C++ MCQ Questions and Answers

Practice Mode
Showing 10 of 93 questions
Q1
C+++ C++
  • A 1
  • B 2
  • C 3
  • D 4
Answer: Option C
Explanation: Explanation
Q2
What is the correct value to return to the operating system upon the successful completion of a program?
  • A -1
  • B 1
  • C 0
  • D Programs do not return a value.
Answer: Option C
Q3
What is the only function all C++ programs must contain?
  • A start()
  • B system()
  • C main()
  • D program()
Answer: Option C
Q4
What punctuation is used to signal the beginning and end of code blocks?
  • A { }
  • B -> and <-
  • C BEGIN and END
  • D ( and )
Answer: Option A
Q5
What punctuation ends most lines of C++ code?
  • A . (dot)
  • B ; (semi-colon)
  • C : (colon)
  • D ' (single quote)
Answer: Option B
Q6
Which of the following is a correct comment?
  • A */ Comments */
  • B ** Comment **
  • C /* Comment */
  • D { Comment }
Answer: Option B
Explanation: Parenthesis
Q7
Which of the following is a correct comment?
  • A */ Comments */
  • B ** Comment **
  • C /* Comment */
  • D { Comment }
Answer: Option C
Q8
Which of the following is not a correct variable type?
  • A float
  • B real
  • C int
  • D double
Answer: Option B
Q9
Which of the following is the correct operator to compare two variables?
  • A A. :=
  • B B. =
  • C C. equal
  • D D. ==
Answer: Option D
Q10
Which of the following is true?
  • A 1
  • B 66
  • C .1
  • D -1
Answer: Option
Questions and Answers for Competitive Exams Various Entrance Test