for loop: example B

Here is the program that prints out the numbers from 1 to 10.
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

CS101 - for loop: example B / Robert I. Pitts / rip@cs.bu.edu