program perkalian_matrix;
var
a,n: integer;
a: array [1..2,1..3] of
integer;
b: array [1..3,1..2] of
integer;
begin
writeln('program
menghitungperkalianmatrik');
writeln();
for a:=1 to 3 do
for n:=1 to 2 do
begin
write('masukkannilaimatrik
a[',a,',',n,']=');
readln(a[a,n]);
end;
writeln('matriks a');
for a:=1 to 3 do
begin
write('|');
for n:=1 to 2 do
write(a[a,n]:5);
write('|');
writeln;
end;
for a:=1 to 2 do
for n:=1 to 3 do
begin
write('masukkannilaimatrik
b[',a,',',n,']=');
readln(b[a,n]);
end;
writeln;
writeln('matriks b');
for a:=1 to 2 do
begin
write('|');
for n:=1 to 3 do
write(b[a,n]:5);
write('|');
writeln;
end;
writeln('makahasildarimatrik
a*b=');
for a:=1 to 3 do
begin
write('|');
for n:=1 to 3 do
write(a[a,n]+b[a,n]:5);
write('|');
writeln;
end;
end.
0 comments:
Posting Komentar