The problem is that this program crashes:
program Arrays;
var
a: array[1..5] of Integer;
i, j, tmp: Integer;
begin
a[1] := 23;
a[2] := 45;
a[3] := 12;
a[4] := 56;
a[5] := 34;
for i := 1 to 4 do
for j := i to 5
if a[j] > a[j + 1] then
begin
tmp := a[j];
a[j] := a[j + 1];
a[j + 1] := tmp;
end;
end.
I can't figure out what's wrong with it, it's in the tutorial that way exactly. I've been trying to get it right for a while but I just can't make it work. I'm using the latest Free Pascal compiler. The tutorial can be found here.
Thank You.