This example shows the basic way that While… …EndWhile loop functions.
This program simply carries on until the user enters Zero. This is not particularly useful as it does nothing with the numbers nor does it tell the user what to do.
However, do notice though that the input statement is repeated inside the loop as well as before entering the loop – it is essential that the variable used to control the loop gets changed inside the loop – other wise the loop will go on forever! Also note that the decision has been modified between the flowchart and the code – they both do exactly the same – it is the labelling on the decision box output lines that dictates the comparison used.