Matrix

15 03 2010

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.


Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: