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

Ads by google

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

The terminating condition occurs unexpectedly

The program will be executed more than one time

The body of loop will be executed at least once

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