Wednesday, March 20, 2013

MENGITUNG DETERMINAN MATRIX ORDO 2X2

1. Algorithm:



2. Translasi C++ :
#include <iostream>
#include <string>

using namespace std;
int main()
{
   string raptor_prompt_variable_zzyz;
    double det;
    double a;
    double b;
    double c;
    double d;

   raptor_prompt_variable_zzyz ="masukkan nilai baris 1 kolom 1 =";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> a;
   raptor_prompt_variable_zzyz ="masukkan nilai baris 1 kolom 2 =";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> b;
   raptor_prompt_variable_zzyz ="masukkan nilai baris 2 kolom 1 =";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> c;
   raptor_prompt_variable_zzyz ="masukkan nilai baris 2 kolom 2 =";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> d;
   det =a*d-(b*c);
   cout << "determinan matrix = "<< det << endl;
   system ("PAUSE");
   return 0;
}

0 comments:

Post a Comment