Next: , Previous: , Up: Statements   [Contents][Index]

7.8 DO-WHILE Statement

The DO-WHILE statement repeats a statement while a condition, tested at the end of the loop, is met.

DO statement WHILE expr

The statement statement is executed. Then the condition expr is evaluated. If the condition is zero (false), then the loop terminates. Otherwise, the loop is repeated until the condition does become false. The statement is always executed at least once, even if the condition is initially false.