WHILE

A conditional expression that is evaluated before each repetition of the specified statement.

statement

A single or compound statement to be executed repeatedly.

Discussion

The WHILE statement executes a statement repeatedly as long as a specified condition is true. Statement is executed while condition is true. When the condition becomes false, control transfers to the logical statement after the WHILE.

Statement can be on the next logical line from WHILE condition. If DO is present, it must be on the same logical line as WHILE.

Statement is not executed if condition is false at the initial iteration.