Mencari Invers Matriks

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

MENCARI INVERS MATRIKS MENGUNAKAN PASCAL program matriks; uses wincrt; vara,b,c,d,i,invers,p,q,r,s:real; jawab:char; pass:string[8]; begin clrscr; gotoxy(25,10);

write('Masukkan Password = '); readln(pass); if not(pass='PaScAl') then begin gotoxy(25,12); writeln('Invalid password !!!!'); end; while pass='PaScAl' do begin repeat clrscr;gotoxy(20,1); writeln('Mencari Invers MatriksOrdo 2x2 '); gotoxy(10,5);write('a=');read(a); gotoxy(18,5);write('b=');read(b); gotoxy(10,7);write('c=');read(c); gotoxy(18,7);write('d=');read(d); i:=(a*d)-(b*c); if not(i=0) then begin invers:=1/((a*d)-(b*c)); p:=d*invers; q:=-b*invers; r:=-c*invers; s:=a*invers; gotoxy(25,10);writeln('Invers matriks A ='); gotoxy(10,13);write(p:0:3); gotoxy(18,13);write(q:0:3); gotoxy(10,16);write(r:0:3); gotoxy(18,16);write(s:0:3); end else

begin gotoxy(25,15); writeln('Tidakada invers matriks'); end; gotoxy(10,18); writeln('Tekansembarangtomboluntukmengulangatau X untukkeluar'); jawab:=readkey; until upcase(jawab)='X'; halt; end; end.

You might also like