Musthopz's Site

Share Everything.

Matrik Pada Pascal Ordo 2×2


uses crt;
var
x,y: integer;
a,b,tot,min: array [1..2,1..2] of integer;
begin
for x:= 1 to 2 do
begin
for y:= 1 to 2 do
begin
write(‘Masukkan Nilai Matriks A = ‘);
read(a[x,y]);
end;
end;
for x:= 1 to 2 do
begin
for y:= 1 to 2 do
begin
write(‘Masukkan Nilai Matriks B = ‘);
read(b[x,y]);
end;
end;
clrscr;
writeln(‘Matriks A’);
for x:= 1 to 2 do
begin
write(a[x,y], ‘ ‘);
end;
writeln;
writeln(‘Matriks B’);
for x:= 1 to 2 do
begin
for y:= 1 to 2 do
begin
write(b[x,y], ‘ ‘);
end;
writeln;
end;
for x:= 1 to 2 do
begin
for y:= 1 to 2 do
begin
tot[x,y]:=a[x,y]+b[x,y];
end;
end;
writeln(‘Matriks A + Matriks B’);
for x:= 1 to 2 do
begin
for y:= 1 to 2 do
begin
write(tot[x,y], ‘ ‘);
end;
writeln;
end;
for x:= 1 to 2 do
begin
for y:= 1 to 2 do
begin
min[x,y]:=a[x,y]-b[x,y];
end;
end;
writeln(‘Matriks A – Matriks B’);
for x:= 1 to 2 do
begin
for y:= 1 to 2 do
begin
write(min[x,y], ‘ ‘);
end;
writeln;
readln;
end;
end.

Single Post Navigation

Tinggalkan Jejak anda

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: