Multiple choice technology programming languages

Which looping process checks the test condition at the end of the loop?

  1. for

  2. while

  3. do-while

  4. no looping process checks the test condition at the end

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The do-while loop is unique in that it checks the test condition at the end of each iteration. This guarantees the loop body executes at least once, even if the condition is initially false. For and while loops check conditions at the start.