Asked by Sarah Boktor on Jun 10, 2024

verifed

Verified

Which of the following loops is guaranteed to execute at least once?

A) counter-controlled while loop
B) for loop
C) do...while loop
D) sentinel-controlled while loop

Do...While Loop

A control flow statement that executes a block of code at least once and then repeats as long as a specified condition remains true.

Sentinel-Controlled While Loop

A loop that continues execution until a special value, known as a sentinel value, is encountered which terminates the loop.

  • Comprehend the criteria for entering and exiting loops in programming.
verifed

Verified Answer

SA
Sadia AhmadJun 12, 2024
Final Answer :
C
Explanation :
The do...while loop is guaranteed to execute at least once because the condition is checked at the end of the loop, after the statements in the loop have been executed at least once.