A while loop is a way to repeat a section of code until a condition stops being true.
The condition is checked at the start of each loop; when it is false, the loop ends.Because the condition is checked before the loop body, the loop body will not be executed if the condition is already false when the loop starts.
<CONDITION> is any Boolean expression to be checked before each run through the loop.
<BODY> is the code to execute repeatedly.
The following example asks the user to enter 3 positive numbers.
If the user enters a negative number, they are allowed to retry.
We don't know how many total tries it will take the user, but the while loop continues until we get all 3.