#include <cstdlib> |
#include <iostream> |
using namespace std; |
class matrik { |
public : |
void baca1(); |
void tulis1(); |
void hitung(); |
double data1[2][2]; |
private : |
double a,b; |
}; |
void matrik::baca1 (){ |
for(int a=1;a<=2;a++) |
for(int b=1;b<=2;b++){ |
cout<<"MASUKKAN "<<a<<" "<<b<< " : "; |
cin>>data1[a][b];} |
} |
void matrik::tulis1 (){ |
for(int a=1;a<=2;a++){ |
for(int b=1;b<=2;b++) |
cout<<" "<<data1[a][b]; |
cout<<endl;} |
} |
void matrik::hitung (){ |
cout<<" "<<((data1[1][1])*(data1[2][2]))-((data1[1][2])*(data1[2][1]))<<endl; |
} |
int main() |
{ |
matrik a; |
cout<<"MASUKKAN DATA MATRIKS \n"<<endl; |
a.baca1(); |
cout<<"DATA MATRIKS YAITU : \n"<<endl; |
a.tulis1(); |
cout<<"DETERMINAN : \n"<<endl; |
a.hitung(); |
system("PAUSE"); |
return EXIT_SUCCESS; |
} |
Senin, 21 Maret 2011
DETERMINAN MATRIKS BERORDO 2X2
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar