Selamat Datang Di Kelas Produktif Teknik Komputer Jaringan

27 September 2014

program pascal penjumlahan dua buah matrix

Program _Pengurangan_2Buah_Matriks;
Uses Crt;
Var B,K,Br,Kl,C,L : Byte;
M1,M2,M3 : Array[1..10,1..10] of Byte;
Begin
   Clrscr;
   Gotoxy(10,5);Write('***** Menjumlahkan Dua Buah Matriks*****');
   Gotoxy(10,7);Write('Jumlah Ordo Matriksnya = x ');
   Gotoxy(35,7);Readln(B);
   Gotoxy(39,7);Readln(K);
   Gotoxy(10,9);write('Masukkan Matriks Ke Satu');
   L:=10;
For br := 1 to b do
Begin
    c := 15;
    For kl :=1 to k do
Begin
    gotoxy(c,l);readln(m1[br,kl]);
    c := c - 2;
end;
    l := l - 1;
end;
  
Gotoxy(10,14);write('Masukkan Matriks Ke Dua');
    l:=15;
For br := 1 to b do
Begin
   C := 15;
For kl := 1 to k do
Begin
   Gotoxy(c,l);readln(m2[br,kl]);
   C := c - 2;
end;
   L := L - 1;
end;

   Gotoxy(10,18);write('Maka Hasil Penjumlahan Matriks');
   L:=20;
For br := 1 to b do
Begin
   C:=15;
For kl := 1 to k do
Begin
   M3[br,kl] := M1[br,kl] + M2[br,kl];
   Gotoxy(c,l);Write(m3[br,kl]);
   C := c - 2;
end;
end;
end.