Listing programnya adalah sebagai berikut:
uses crt;
var
x,y,z:array[1..100,1..100] of byte;
a,b,c:byte;
procedure input;
var
i,j:byte;
begin
writeln(‘Program matriks’);
writeln(‘—————’);
write(‘Jumlah baris 1 : ‘);
readln(a);
write(‘Jumlah kolom 1 : ‘);
readln(b);
writeln;
for i:=1 to a do
for j:=1 to b do
begin
write(‘Matriks 1[',i,',',j,'] : ‘);
readln(x[i][j]);
end;
writeln;
for i:=1 to b do
for j:=1 to a do
begin
write(‘Matriks 2[',i,',',j,'] : ‘);
readln(y[i][j]);
end;
end;
procedure outputmatriks1;
var
i,j:byte;
begin
write(‘Matriks1′); writeln;
for i:=1 to a do
begin
for j:=1 to b do
begin
write(x[i][j]);
write(‘ ‘);
end;
writeln;
end;
end;
procedure outputmatriks2;
var
i,j:byte;
begin
write(‘Matriks2′);writeln;
for i:=1 to a do
begin
for j:=1 to b do
begin
write(y[i][j]);
write(‘ ‘);
end;
writeln;
end;
end;
begin
clrscr;
input;
outputmatriks1;
outputmatriks2;
readkey;
end.
Tidak ada komentar:
Posting Komentar