3.2.4 do while 

Previous Index Next


The do while statement executes a statement and evalutes an expression until the expression is false. The basic syntax is as follows:
do
  {
    StatementToExecute
  }
while ( Expression );
For example:
int q = 0;         //declare q and initialize it to 0

do
  {
    q =q + 10;     // add 10 to q
  }
while ( q < 100);  // while q is less then 100