Which of the following loop instructions checks the loop continuation condition only after the iteration has been completed?
for ... in
while
for
do ... while
Explanation & Hint:
The “do … while” loop instruction checks the loop continuation condition only after the iteration has been completed. In the “do … while” loop, the code block is executed first, and then the condition is checked. If the condition evaluates to true, the loop continues executing. This guarantees that the code block is executed at least once, regardless of the condition. |