Question Detail

COS 102 test topic Objective Question

Question

Which algorithmic construct executes a block of code at least once regardless of whether the condition is initially true?
Options
A For loop
B While loop
C Do-while loop
Correct Answer
D If-else branch
Correct Answer

Option C is the correct answer.

Detailed Explanation

A do-while loop is a post-test loop; its condition is checked after the loop body completes its initial iteration.

Hint

No hint available

Question Info