The While Loop (2)
In this example the result of the loop is that sum contains the sum of the number 1 …9
The loop terminates when x equals 10.
If the guard evaluates to true the associated set of statements (the loop body) are executed, this is repeated while the guard remains true.