do do-while Statement
do
statement
while (expression);
The do-while statement executes the statements in the body, and then
evaluates the looping criteria at the end of the loop. If the
expression is true, the loop is re-entered and the body is executed
again. When the expression tests false control is passed to the next
statement following the loop.
Notes: With the do-while construct, the statements in the body
are always executed at least once. That's because the
condition is tested at the end of the loop, rather than
at the beginning--as in the `for' and `while' statements.
You can terminate a do statement prematurely by using a
continue or break statement.
-------------------------------- Example ---------------------------------
do { /* Use braces for multiple statements */
process();
i++;
} while (i < 20);
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster