Contoh Program Penjumlahan Matriks Pada Pascal
Penjumlahan Matriks Pada Pascal |
Hai, sobat setia dottechno16 kali ini ya kali ini mimin mau membagikan source code program penjumlahan matriks pada Pascal.
Monggo disimak program di bawah dengan seksama, apabila ada pertanyaan tinggalkan pada kolom komentar :))
Source Code :
program praktikum_struktur_data;
uses crt;
var ar0pr1, ar0pr2, ar0pr3: array[1..2,1..2] of integer;
i, j:integer;
begin
var ar0pr1, ar0pr2, ar0pr3: array[1..2,1..2] of integer;
i, j:integer;
begin
clrscr;
writeln ('operand 1');
for i:= 1 to high (ar0pr1) do
for j:= 1 to high (ar0pr1[i]) do
begin
write('masukan elemen baris[',i,'] kolom[',j,']=');
readln(ar0pr1[i,j]);
end;
writeln ('operand 1');
for i:= 1 to high (ar0pr1) do
for j:= 1 to high (ar0pr1[i]) do
begin
write('masukan elemen baris[',i,'] kolom[',j,']=');
readln(ar0pr1[i,j]);
end;
writeln ('operand 2');
for i:=1 to high (ar0pr2) do
for j:=1 to high (ar0pr2[i]) do
begin
write('masukan elemen baris[',i,'] kolom[',j,']=');
readln(ar0pr2[i,j]);
end;
writeln('elemen matrik operand 1 adalah');
for i:=1 to high (ar0pr1) do begin
for j:= 1 to high (ar0pr1[i]) do
write (ar0pr1[i,j]:3);
readln;
end;
writeln('elemen matriks operand 2 adalah');
for i:=1 to high (ar0pr2) do begin
for j:=1 to high (ar0pr2[i]) do
write(ar0pr2[i,j]:3);
readln;
end;
for i:=1 to high (ar0pr2) do
for j:=1 to high (ar0pr2[i]) do
begin
write('masukan elemen baris[',i,'] kolom[',j,']=');
readln(ar0pr2[i,j]);
end;
writeln('elemen matrik operand 1 adalah');
for i:=1 to high (ar0pr1) do begin
for j:= 1 to high (ar0pr1[i]) do
write (ar0pr1[i,j]:3);
readln;
end;
writeln('elemen matriks operand 2 adalah');
for i:=1 to high (ar0pr2) do begin
for j:=1 to high (ar0pr2[i]) do
write(ar0pr2[i,j]:3);
readln;
end;
writeln(' hasil penjumlahannya adalah: ');
for i:=1 to high (ar0pr3) do
for j:=1 to high (ar0pr3[i]) do
ar0pr3[i,j]:= ar0pr1[i,j]+ar0pr2[i,j];
for i:=1 to high (ar0pr3) do
for j:=1 to high (ar0pr3[i]) do
ar0pr3[i,j]:= ar0pr1[i,j]+ar0pr2[i,j];
for i:=1 to high(ar0pr3) do begin
for j:=1 to high (ar0pr3[i]) do
write(ar0pr3[i,j]:3);
for j:=1 to high (ar0pr3[i]) do
write(ar0pr3[i,j]:3);
writeln;
end;
readln;
readln;
end;
readln;
readln;
end.
Coba jalankan program di atas pada compiler Pascal yang kalian gunakan :))
Cukup mudah bukan program tersebut :))
Tags : Pascal, Free Pascal, Penjumlahan Matriks, Matriks Penjumlahan, Tugas Kuliah, Charm Pascal, Kuliah, Informatika.
0 Response to "Contoh Program Penjumlahan Matriks Pada Pascal"
Post a Comment