This is the C code for determinant of matrix, But it gives compilation errors.
Code is:
#include<stdio.h>
#include<math.h>
int m;
float determinant(float b[][]);
int main(void)
{
int i,j,m;
printf("enter a no: ");
scanf("%d",&m);
//printf("%d",m);
float arr[m][m];
for(i=0;i<m;i++)
{
    for(j=0;j<m;j++)
    {
        scanf("%f",&arr[i][j]);
        //printf("%f",arr[i][j]);
    }
}
for(i=0;i<m;i++)
{
    for(j=0;j<m;j++)
    {
        printf("%f ",arr[i][j]);
    }
    printf("\n");
}
float det = determinant(arr);
printf("Determinant= %f ", det);
}
float determinant(float b[][])
{
int i,j;
int p;
float sum = 0;
float c[m][m];
for(i=0;i<m;i++)
{
    for(j=0;j<m;j++)
    {
        printf("%f ",b[i][j]);
    }
    printf("\n");
}
if(m==2)
{
    printf("Determinant for m=2");
    sum = b[0][0]*b[1][1] - b[0][1]*b[1][0];
    return sum;
}
for(p=0;p<m;p++)
{
    int h = 0,k = 0;
    for(i=1;i<m;i++)
    {
        for( j=0;j<m;j++)
        {
            if(j==p)
                continue;
            c[h][k] = b[i][j];
            k++;
            if(k == m-1)
            {   
                h++;
                k = 0;
            }
        }
    }
    m=m-1;
    sum = sum + b[0][p]*pow(-1,p) * determinant(c);
}
return sum;
}
And the Compilation Errors are:
det.c:5:25: error: array type has incomplete element type
det.c: In function ‘main’:
det.c:36:2: error: type of formal parameter 1 is incomplete
det.c: At top level:
det.c:45:25: error: array type has incomplete element type
det.c: In function ‘determinant’:
det.c:91:3: error: type of formal parameter 1 is incomplete
det.c:99: confused by earlier errors, bailing out
Preprocessed source stored into /tmp/cc1Kp9KD.out file, please attach this to your bug report.
I think the error is in the passing of 2-D Array. when I passing it as a pointer then it gives warnings but no errors but it does not give the right result as in always gives determinant as Zero. So I guess the array is not being passed only and when I print it in the function determinant it doesn't print also. Please help as I am stuck because of this in my project.
 
     
     
     
     
    