Programs to Debug: Number 3

We suggest that you inspect this program to see if you can spot the errors before attempting to compile it in Delphi or Lazarus. Make the necessary changes so that each program will compile and achieve the stated purpose. Our pages on common programming errors may help you.

program Cube;
{$APPTYPE CONSOLE}
{This program should output the cubes of the integers
from 1 to 9.  There are two deliberate errors}
uses
  SysUtils;
var
  i, Cube : integer;
begin
  for i := 1 to 9 do
    begin
      Cube := i * i * i;
      writeln('Cube of ',i,': ',Cube);
    end;
end.
Programming - a skill for life!

Spot the deliberate errors