Main About Download Schemes Documentation Resources

While Shape

Default Appearance

What it Does

A While Loop evaluates a Boolean expression and then, if true, executes a block of statements. After the statements are executed, the While Statementt rechecks the expression. When the expression is false, the loop ends.


The example, to the right, prints the numbers from 1 to 100. The assignment statement "n = n + 1" increments the variable 'n' by 1 for each iteration of the loop.