Find determinant of matrix generated by array rotation | C ++ program for finding determinant of generated matrix ; Function to calculate determinant ; Driver code
#include <bits/stdc++.h> NEW_LINE #define N  3 NEW_LINE using namespace std ; int calcDeterminant ( int arr [ ] ) { int determinant = 0 ; for ( int i = 0 ; i < N ; i ++ ) { determinant += pow ( arr [ i ] , 3 ) ; } determinant -= 3 * arr [ 0 ] * arr [ 1 ] * arr [ 2 ] ; return determinant ; } int main ( ) { int arr [ ] = { 4 , 5 , 3 } ; cout << calcDeterminant ( arr ) ; return 0 ; }