bisa di lihat

Senin, 04 Oktober 2010

Tulisan 3 coding pascal ( matrix )

Nama    : Bobby yohanes
Kelas   : 2 KA 28
Npm     : 10109359
Judul   : coding pascal membuat matix
 
uses crt;
type
   matrix= array[1..25,1..25] of integer;
var
   i,j,k,y,a,b, n,bts : integer;
   x : array [1..100] of longint;
   nama: string;
   matA, matB: matrix;
 
procedure InputMat(var x:matrix);
begin
     for i := 1 to a do
     begin
          for j := 1 to b do
          begin
          write('Masukan elemen[',i,'][',j,']: '); readln(x[i,j]);
          end;
     end;
end;
 
procedure CetakMat(var x:matrix);
begin
     for i:= 1 to a do
     begin
          for j:=1 to b do
          begin
          write(x[i,j], ' ');
          end;
          writeln;
     end;
end;
begin
          clrscr;
          write('Masukan jml baris: '); readln(a);
          write('Masukan jml kolom: '); readln(b);
          writeln('Input Matrix A');
          InputMat(matA);
          writeln('Input Matrix B');
          InputMat(matB);
          writeln;
          write('Matrix A dan B:');
          writeln;
          CetakMat(matA);
          write;
          CetakMat(matB);
          writeln;
     readln;
end.

Tidak ada komentar:

Posting Komentar