Memaknai hidup untuk saling berbagi. Walaupun tidak berbentuk materi, tapi berbagi berupa ilmu dan informasi. Karena Informasi Tiada Henti







Saturday, 3 January 2009

Perkalian 2 Buah Matrix

uses
wincrt;
var
a,b,c:array [1..50,1..50] of integer;
i,j,k,y,z,x:integer;
begin
clrscr;
writeln('Program Untuk Menghitung Perkalian 2 Buah Matriks');
writeln;
writeln(' Ukuran Matriks A');
write(' Baris :');
readln(x);
write(' Kolom :');
readln(y);
writeln;
writeln(' Ukuran Matriks B');
write(' Baris :');
readln(y);
write(' Kolom :');
readln(z);
writeln;
for i:=1 to x do
for j:=1 to y do
begin
write(' Elemen A[',i,',',j,']:');
readln(a[i,j]);
end;
writeln;
for i:=1 to y do
for j:=1 to z do
begin
write(' (Elemen B[',i,',',j,']:'); readln(b[i,j]);
end;
for i:=1 to x do
for j:=1 to z do
for k:=1 to y do
c[i,j]:=c[i,j]+a[i,k]*b[k,j];
writeln;
writeln(' Hasil Perkalian Matriks A dan Matriks B');
writeln;
for i:=1 to x do
begin
for j:=1 to z do
write(c[i,j],'');
writeln;
end;
readln;
end.

Like the Post? Do share with your Friends.

No comments:

Post a Comment

IconIconIconFollow Me on Pinterest

KOMPAS TEKNO

Page Rank

PageRank Checker

What's Hot