Exploring the Ocean of Science

Tugas Praktikum emang bikin orang mabookkk….nah ni salah satunya…
Membuat program penjumlahan matriks dengan Bahasa Pascal….
Buat kalian – kalian yang mengalami masalah yang sama semoga bisa membantuuu….Selamat Mencoba….^_^

Program Penjumlahan Matriks;
uses crt;
type
matrix=array[1..2,1..3] of byte;
var
s,k : matrix;
i,j : integer;

procedure input(var x:matrix);
begin
writeln;
for i:=1 to 2 do
begin
for j:=1 to 3 do
begin
write(‘Masukkan matrix[‘,i,’,’,j,’] : ‘); readln(x[i,j]);
end;
end;
end;

procedure show(var x:matrix);
begin
writeln;
for i:=1 to 2 do
begin
for j:=1 to 3 do
begin
write(x[i,j]:4);
end;
writeln;
end;
writeln;
end;

{Main Program}
begin
clrscr;
writeln(‘Matriks I’);
input(s);

writeln(‘Matriks II’);
input(k);

clrscr;
writeln(‘Matriks I : ‘);
show(s);
writeln(‘Matriks II : ‘);
show(k);

writeln(‘Hasil Penjumlahan Matriks I dan Matriks II : ‘);
for i:=1 to 2 do
begin
for j:=1 to 3 do
begin
write((s[i,j]+k[i,j]):4);
end;
writeln;
end;

readln;
end.

Leave a Reply

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: