while

Iterative while statement.

Syntax

while ( expression ) statement ;

Description

The while statement has the form:

while( expression ) statement

The expression is evaluated before each execution, and the statement is executed zero or more times, as long as the expression is not zero.

Examples

To execute the example below, press or modify the example to try different variations.

Related Links

while , do