Array output
Before reading this I suggest you to have a look at the for loop, click.
Arrays
An Array is a chain of variables of the same type. If we need to declare an array of 10 Integer variables, we can do it like this:
Numbers: array [1 .. 10] of Integer;
We can access single variables in the array using its index. For example, to put a value in the first variable in the array we can write it as:
Numbers[1]:= 30;
To put a value in the second variable, use the index 2:
Numbers[2]:= 315;
Output an array
We need to use the for loop in case you want to output an array. As the example shown here :
program tab;
uses wincrt;
type
tab = array [1..5] of char;
var
t:tab;
c, j: Integer;
begin
t[1]:= 'A';
t[2]:= 'B';
t[3]:= 'C';
t[4]:= 'D';
t[5]:= 'E';
for j:=1 to 5 do
begin
write(' | ', j);
end;
writeln;
for c:=1 to 5 do
begin
write(' | ' ,t[c]);
end;
readln;
end.