Q. Which loop is guaranteed to execute its body at least once?

A
for loop
B
while loop
C
do-while loop
D
for-each loop
Solution:

A do-while loop checks its condition after executing the loop body. Therefore, the body is always executed at least one time, even if the condition is initially false.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!