do While loop

Do While loop


The do while loop is an exit controlled loop, since the body of loop is executed first and then the test condition is evaluated. If it evaluates to false, then the loop is terminated, otherwise it is repeated. This means do while loop always executes at least once, even if the condition is evaluated to false.

Syntax:

do
{
statement 1;
statement 2;
…………….
statement N;
}while(condition);