| 1 |
procedure main() |
| 2 |
local n, sum # Declare two local variables |
| 3 |
sum := 0 # Set the sum to zero |
| 4 |
every n := 1 to 5 do # For n equal to 1, 2, 3, 4, 5 ... |
| 5 |
sum := sum + n; # ...add n to the sum |
| 6 |
|
| 7 |
write ( "The sum of all numbers from 1 to 5 is ", sum ); |
| 8 |
end |