Which loop is guaranteed to execute its body at least once?
Q.Which loop is guaranteed to execute its body at least once?
A) while
B) for
C) none of the loops
D) do-while
Correct Answer:
Option D
Detailed Explanation:
D) do-while is correct. Apply the relevant C++ rules: integer versus floating-point division, remainder, operator precedence, loop execution, ternary selection, data types, and the syntax of main().