111k views
1 vote
This loop will run at least once: ___________

Options:
a. While
b. For
c. Do-While
d. None of the above

1 Answer

4 votes

Final answer:

The 'Do-While' loop is designed to run at least once before evaluating its condition, ensuring that the code block inside it is executed at least one time.

Step-by-step explanation:

The loop that will run at least once regardless of the condition at the start of the loop is the Do-While loop. This is because a Do-While loop executes the code block once before checking the condition. In contrast, a While loop and a For loop first check the condition before executing the code block, which means they might not run at all if the condition is false from the beginning.

User Rees
by
7.6k points