uses crt;
type
matrix = array [1..3, 1..2] of integer;
var
a,b,c : matrix;
i,j : integer;
begin
clrscr;
for i := 1 to 3 do begin
for j := 1 to 2 do begin
write(' nilai matrik1[',i,',',j,']]='); readln(a[i,j]);
end;
end;
writeln;
for i := 1 to 3 do begin
for j := 1 to 2 do begin
write(' nilai matrik2[',i,',',j,']]='); readln(b[i,j]);
end;
end;
writeln;
for i:= 1 to 3 do begin
for j := 1 to 2 do begin
c[i,j]:= a[i,j] + b[i,j];
writeln('nilai matrik3[',i,',',j,']=',c[i,j]);
end;
end;
readkey;
end.
0 komentar:
Posting Komentar