|
|||||||
While ShapeDefault AppearanceWhat it DoesA 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. ExampleThe 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. |