Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
matrix calculator
//samuel ugochukwu nwutobo //matrix calculator //20 jun 2017 #include <iostream> #include <cmath> using namespace std; int main() { int det; int b1,b2,b3,b4,b5,b6,b7,b8,b9; int arr[3][3] { {2,3,-1}, {3,5,2}, {1,-2,-3}}; //uncomment if you want to us input stream /* for(int i =0;i <3;i++) { for(int j=0;j <3; j++) cin>>arr[i][j];} */ b1 =arr[0][0]; b2 =arr[0][1]; b3 =arr[0][2]; b4 =arr[1][0]; b5 =arr[1][1]; b6 =arr[1][2]; b7 =arr[2][0]; b8 =arr[2][1]; b9 =arr[2][2]; det = b1*((b5*b9)-(b6*b8))-b2*((b4*b9)-(b6*b7))+b3*((b4*b8)-(b5*b7)); cout<<"deteminat is: "<<det; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
NameTempSpecial2
Variadic Functor Example
decrypt_problem_5
selection_sort
Sum of digits of number
code_chef
kth smallest element in a matrix
ISPrime
Eratosfen conmment
2015(M2)Mod.
Please log in to post a comment.