The while loop can be summarized as while the expression evaluates to true, execute the statements in the loop. | |
Once the last statement in the loop is executed, go back to the top of the loop and evaluate the expression again. | |
When the expression evaluates to false, the next line of code following the while loop structure is executed. | |
Because the expression is evaluated before the loop, it is possible the loop will never be executed. | |
The format of the while loop looks like the following: | |
| |
|