while (comparison) { instructions... }

do { instructions... } while (comparison) ;

Repeats all instructions between the winged brackets as long as the comparison between the round brackets is true or evaluates to non-zero. This repetition of instructions is called a loop. The while statement evaluates the comparison at the begin, the do..while statement at the end of each repetition.

Remarks:

Example:

x = 0;
while(x < 100) // repeat while x is lower than 100
  x += 1; 

See also:

if, for, break, continue, comparisons, loop

► latest version online