I'm able to find det of matrix 2x2 using this code:
using System;
class find_det
{
static void Main()
{
int[,] x = { { 3, 5, }, { 5, 6 }, { 7, 8 } };
int det_of_x = x[0, 0] * x[1, 0] * x[0, 1] * x[1, 1];
Console.WriteLine(det_of_x);
Console.ReadLine();
}
}
But when I tried to find det of 3x3 Matrix, using this code:
using System;
class matrix3x3
{
static void Main()
{
int[,,] x={{3,4,5},{3,5,6},{5,4,3}};
int det_of_x=x[0,0]*x[0,1]*x[0,2]*x[1,0]*x[1,1]*x[1,2]*x[2,0]*x[2,1]*x[2,2];
Console.WriteLine(det_of_x);
Console.ReadLine();
}
}
It got error. Why?