Mencari determinan matriks berordo 2×2

Algoritma :

  1. Masukkan elemen1 (a)
  2. Masukkan elemen2 (b)
  3. Masukkan elemen3 (c)
  4. Masukkan elemen4 (d)
  5. Determinan = (a x d) – (b x c)

Program :

#include <iostream>
#include <conio.h>

using namespace std;

int main(){
int e1,e2,e3,e4;
cout<<"Determinan matriks berordo 2 x 2"<<endl;
cout<<"Masukkan elemen1 (a) : "
cin>>e1;
cout<<"Masukkan elemen2 (b) : "
cin>>e2;
cout<<"Masukkan elemen3 (c) : "
cin>>e3;
cout<<"Masukkan elemen4 (d) : "
cin>>e4;
//mencari determinan matriks.
//determinan = ( a x d ) – ( b x c )
//deteremian = ( e1 x e4 ) – ( e2 x e3 )
cout<<"Determinan matriks : "<<(e1*e4)-(e2*e3);

getch();
return 0;
}

Output :

Posted on Maret 23, 2011, in Tugas PTI. Bookmark the permalink. Tinggalkan komentar.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: