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