Algoritma:
-masukkan p, q, r, s
-hitung dengan rumus : det=(p*s)-(q*r)
-hasil determinan berordo 2x2
Progam:
#include <iostream.h>
int main(){
int p,q,r,s;
int det;
cout << " masukkan nilai p : ";
int det;
cout << " masukkan nilai p : ";
cin >> p;
cout << " masukkan nilai q : ";
cout << " masukkan nilai q : ";
cin >> q;
cout << " masukkan nilai r : ";
cout << " masukkan nilai r : ";
cin >> r;
cout << " masukkan nilai s : ";
cout << " masukkan nilai s : ";
cin >> s;
det = ( p*s) - ( q*r);
cout << " nilai determinan = " << det << endl;
getch();
return 0;
}
det = ( p*s) - ( q*r);
cout << " nilai determinan = " << det << endl;
getch();
return 0;
}
Tidak ada komentar:
Posting Komentar