The loop that will execute the body of the loop at least once even when the condition controlling the loop is initially false is the do-while loop.
Explanation:
- A do-while loop first executes the loop body and then checks the loop condition. Therefore, the body is guaranteed to execute at least once regardless of whether the condition is true or false initially.
- Other loops like while and for check the condition before executing the body, so if the condition is initially false, the loop body will not execute even once.
This is sometimes called an exit-controlled loop because the condition is checked after the body executes, unlike entry-controlled loops such as while and for which check the condition before entering the loop body. Hence, among the options:
- do-while: executes body at least once even if condition is false initially.
- while: executes only if condition is true initially.
- for: executes only if condition is true initially.
The correct answer is do-while loop.