I l @ ve RuBoard |
The keywords for the do while statement are do and while .
The do while statement creates a loop that repeats until the test expression becomes false or zero. The do while statement is an exit-condition loop; the decision to go through one more pass of the loop is made after the loop has been traversed. Therefore, the loop must be executed at least once. The statement part of the form can be a simple statement or a compound statement.
do statement while ( expression );
The statement portion is repeated until the expression becomes false or zero.
do scanf("%d", &number) while(number != 20);
I l @ ve RuBoard |