Uses
Wincrt;
Var
A,B,C : Array [1..10,1..10] Of Integer;
I,J,K,X,Y,Z : Integer;
Begin
Writeln('Selamat Datang Di Program Perkalian Matrik');Writeln;
Writeln('Matrix A');
Write('Isi Baris : '); Readln(X);
Write('Isi Kolom : '); Readln(Y);
Writeln;
Writeln('Matrix B');
Writeln('Isi Baris : ',Y);
Write('Isi Kolom : '); Readln(Z);
Writeln;
Writeln ('Matrix A');
For I:=1 To X DoFor J:=1 To Y Do
Begin
Write('A[',I,',',J,'] : ');Readln(A[I,J]);
End;
Writeln;
Writeln ('Matrix B');For I:=1 To Y Do
For J:=1 To Z Do
Begin
Write('B[',I,',',J,'] : '); Readln(B[I,J]);
End;
For I:=1 To X Do
For J:=1 To Z DoFor K:=1 To Y Do
C[I,J] := C[I,J] + A[I,K]*B[K,J];
Writeln;
Writeln('Hasil Matrix A X Matrix B : ');
Writeln;
For I:=1 To X Do
Begin
For J:=1 To Z Do
Write(C[I,J]:5);
Writeln;
Writeln;
End;
End.
Hasil Akhir :
Jawaban :
Tidak ada komentar:
Posting Komentar