site banner
Unable to load image

Math challenge for math monday[tuesday] (sorry was busy): Build a computer code to calculate the amount of 2×2 determinents for an nth order matrix using c++

Ill post my code later.

Hints:

The growth can be found using a recursive series and the associated logic.

Will require a for loop.

11
Jump in the discussion.

No email address required.

Figured it out. 42 to the exponent of 6.

  • 4
Jump in the discussion.

No email address required.

goes hard yo

  • 4
Jump in the discussion.

No email address required.

Soynic's Toe is a real one.

  • 4
Jump in the discussion.

No email address required.

Real

  • 3
Jump in the discussion.

No email address required.

#include <iostream></iostream>

//only one type of std used so namespace is ok

Using namespace std;

int main(){

//intialization of variables

int factorial = 1;

int rentfreeisastrag;

// check for proper input from user

do{

cout << "Enter the order of the matrix\n**";

cin >> rentfreeisastrag;

if(cin.fail()){

cout << "Hey cute twink! Thats not an integer! Do it again" << endl;

cin.clear();

cin.ignore(100, '\n');

continue;

}

else if( rentfreeisastrag ==1){

cout << "Hey cute twink! That's a scalar.

REDO" << endl;

cin.clear();

cin.ignore(100, '\n');

continue;

}

else if( rentfreeisastrag < 1){

cout << "Hey cute twink! That doesnt exist!" << endl;

cin.clear();

cin.ignore(100, '\n');

continue;

}

}while(cin.fail() || rentfreeisastrag <= 1)

// calculation of the factorial

for( int norentfreeirl = rentfreeisastrag; norentfreeirl > 1; norentfreeirl--){

factorial = factorial*norentfreeirl;

}

// actual 2x2's needed to be computed

determinComp= factorial/2;

cout << "The 2 by 2 determinants computed is " << determinComp << endl;

if( determinComp > 60){

cout << "Good luck!" << endl;

}

return 0;

}Not the most optimized. But i hate switch statements.

  • 2
Jump in the discussion.

No email address required.

I got to pee so goddamn bad.. Can I pee in you butthole while I crack your back?

  • 1
Jump in the discussion.

No email address required.