Monday, 4 January 2010

Program Jumlah Matriks (ordo2)&det pd pascal

uses crt;
var m1, m2 : array [1..2,1..2] of integer;
lok : array [1..4] of integer;
det,ordo,i,j,k : integer;

begin
clrscr;
write('Masukkan ordo Matrik : '); readln(ordo);
writeln;
write ('Masukan Elemen Matrik ',ordo,'X',ordo);
writeln;
for i := 1 to ordo do
begin
for j := 1 to ordo do
writeln;
gotoxy (5,5); writeln (' Input Matrik I');
for i:= 1 to 2 do
begin
for j := 1 to 2 do
begin
write ('Elemen Matrik [',i,',',j,'] : ');
readln (m1[i,j]);
end;
end;
end;
gotoxy (39,5); writeln('Input Matrik II');
k:=6;
for i:= 1 to 2 do
begin
for j := 1 to 2 do
begin
gotoxy(35,k);
inc (k);
write ('elemen Matrik [',i,',',j,'] : ');
readln (m2[i,j]);
end;
end;

writeln;
writeln;
writeln(' * Matrik I *');
writeln;
writeln (m1[1,1]:5,m1[1,2]:5);
writeln;
writeln (m1[2,1]:5,m1[2,2]:5);
writeln;
writeln('* Matrik II *');
writeln;
writeln (m2[1,1]:5,m2[1,2]:5);
writeln;
writeln (m2[2,1]:5,m2[2,2]:5);
readln;

gotoxy(20,12);writeln('>>>Transpose Matriks I<<<'); gotoxy(25,14);writeln(m1[1,1]:5,m1[2,1]:5);
gotoxy(25,16);writeln(m1[1,2]:5,m1[2,2]:5);
gotoxy(20,18);writeln('>>>Transpose Matriks II<<<'); gotoxy(25,20);writeln(m2[1,1]:5,m2[2,1]:5);
gotoxy(25,22);writeln(m2[1,2]:5,m2[2,2]:5);
readln;

det := ((m1[1,1] * m1[2,2]) - (m1[1,2] * m1[2,1]));
gotoxy(50,12);writeln('Determinan Matriks I : ',det);
det := ((m2[1,1] * m2[2,2]) - (m2[1,2] * m2[2,1]));
gotoxy(50,14);writeln('Determinan Matriks II : ',det);

gotoxy(50,18);writeln ('>>Hasil Penjumlahan Matriks<<');
lok[1] := m1[1,1]+m2[1,1];
lok[2] := m1[1,2]+m2[1,2];
lok[3] := m1[2,1]+m2[2,1];
lok[4] := m1[2,2]+m2[2,2];
gotoxy(57,20);writeln (lok[1]:5,lok[2]:5);
gotoxy(57,22);writeln(lok[3]:5,lok[4]:5);
readln;

end.

Selamat Mencoba

Posting Terkait

2 comments:

Noor Fitriana H said...

kunjungan balik bro...

follow me jg yak ^^

blognguik.blogspot.com

Unknown said...

kita juga punya nih jurnal mengenai matriks, silahkan dikunjungi dan dibaca , berikut linknya
http://repository.gunadarma.ac.id/bitstream/123456789/4864/1/DOKUMEN%20PRESENTASI.pdf
semoga bermanfaat yaa :)

Balas

Post a Comment

Mikail Alfith Amarullah

↑ Grab this Headline Animator

IKLAN

  © Blogger Tamplates

Back to TOP