program forloopB; { This program demonstrates a "for" loop. It uses the loop to print out the numbers from 1 to 10. } var i : integer; { looping variable } begin for i := 1 to 10 do writeln(i); end.
Below we show a compilation and run of the program.
% pc forloopB.p % a.out 1 2 3 4 5 6 7 8 9 10