Practice Examination (2026 Edition) | Latest
2026 Curriculum | Advanced University-
Level Multiple-Choice Questions | Verified
Answers with Detailed Rationales |
Comprehensive C++ Programming Exam
Preparation
Question 1
Which of the following is the correct entry point of every
standard C++ program?
A. start()
B. begin()
C. main()
D. execute()
Answer: C
Rationale: Every C++ program begins execution from the
main() function.
Question 2
Which header file is required to use cout and cin?
,A. <cstdio>
B. <iomanip>
C. <iostream>
D. <fstream>
Answer: C
Rationale: The iostream library provides standard input and
output objects.
Question 3
Which operator is used to access members of an object?
A. ::
B. **
C. ->
D. .
Answer: D
Rationale: The dot operator accesses members of an object
instance.
Question 4
Which data type stores decimal numbers?
A. int
B. char
,C. bool
D. double
Answer: D
Rationale: double stores floating-point values with higher
precision.
Question 5
What is the size of a bool variable?
A. 8 bytes
B. 4 bytes
C. Implementation-defined (commonly 1 byte)
D. 16 bytes
Answer: C
Rationale: The C++ standard does not mandate a specific size,
though one byte is common.
Question 6
Which keyword prevents a variable from being modified?
A. static
B. volatile
C. auto
D. const
, Answer: D
Rationale: const creates read-only variables.
Question 7
Which loop always executes at least once?
A. for
B. while
C. range-based for
D. do-while
Answer: D
Rationale: The condition is checked after the loop body
executes.
Question 8
Which statement exits a loop immediately?
A. continue
B. return
C. goto
D. break
Answer: D
Rationale: break terminates the nearest enclosing loop.