A do-while loop is more appropriate than for loop when.

A do-while loop is more appropriate than for loop when:

Incorrect

The terminating condition occurs unexpectedly

Incorrect

The program will be executed more than one time

Correct

The body of loop will be executed at least once

Incorrect

The number of times the loop will be executed is known before the loop is executed

Google Ads