Contoh program dengan array di pascal kiriman Made Intan Dwipayani
uses wincrt;
var baris, kolom,i,j : integer;
a : array [1..50,1..50] of integer;
Begin
Clrscr;
Write('Masukkan Jumlah Baris : ');Readln(baris);
Write('Masukkan Jumlah Kolom : ');Readln(kolom);
Writeln;
Gotoxy(1,5);Write('A= '); {gotoxy = mengarahkan cursor ke x,y}
for i := 1 to baris do
for j := 1 to kolom do
begin
Gotoxy(j*5,i*2+3); {gotoxy = mengarahkan cursor ke x,y}
Readln(A[i,j]);
end;
Gotoxy(30,5);Write('AT='); {gotoxy = mengarahkan cursor ke x,y}
for i := 1 to kolom do
for j := 1 to baris do
begin
Gotoxy(j*5+30,i*2+3); {gotoxy = mengarahkan cursor ke x,y}
Write(A[j,i]);
end;
End.
Made Intan Dwipayani
[email protected]