program matrik_uts;
uses wincrt;
var
a,b,c,d :array[1..10,1..10] of integer;
x,y,kol,bar:integer;
begin
write('jumlah kolom =');readln(kol);
write('jumlah baris =');readln(bar);
writeln;
writeln('masukkan matrik a');
for x:=1 to bar do
begin
for y:=1 to kol do
begin
write('[',x,':',y,'] = ');readln (a[x,y]);
end;
end;
writeln('masukkan matrik b');
for x:=1 to bar do
begin
for y:=1 to kol do
begin
write('[',x,':',y,'] = ');readln (b[x,y]);
end;
end;
writeln('masukkan matrik c');
for x:=1 to bar do
begin
for y:=1 to kol do
begin
write('[',x,':',y,'] = ');readln (c[x,y]);
end;
end;
for x:=1 to bar do
begin
for y:=1 to kol do
begin d[x,y]:= a[x,y]+b[x,y]-c[x,y];
/> end;
end;
writeln('hasil penjumlahan');
for x:=1 to bar do
begin
for y:=1 to kol do
begin
write (d[x,y]:4);
end;
writeln;
end;
end.
Rabu, 25 April 2012
Program Penjumlahan Dan Pengurangan Matriks
Tampilan
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar