Advanced Control Flow – The Do While Loop

The Do While Loop is a loop that guarantees execution of the statements within the loop at least once.

The structure of the Do While Loop

Below is the structure:

do { 

//statements 

} while ( condition(s) ) ;

What is this useful for? In order to execute a set of commands at least once.

Tags: , ,