Minggu, 04 Maret 2012

Program Perkalian 2 Matrix

Program Perkalian_Matrix_Shagaf;
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 Do
For 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 Do
For 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 :

  1. Program Untuk Perkalian Dua Matrix
  2. Program Untuk Menampilkan Matrix Identitas Terbalik

Tidak ada komentar:

Posting Komentar