I'm having trouble returning a value from a function and passing it to another function!! I need to return n from cmat and pass it to printmat
Code:
void cmat(float mat[MAX_MAT_SIZE][MAX_MAT_SIZE]
Code:
{
int i,j,n;
printf("\nEnter the order of matrix: ");
scanf("%d",&n);
printf("\nEnter the elements of augmented matrix:\n\n");
for(i=1; i<=n; i++)
{
for(j=1; j<=(n+1); j++)
{
printf("A[%d][%d] : ", i,j);
scanf("%f",&mat[i][j]);
}
}
}
void printmat(float mat[MAX_MAT_SIZE][MAX_MAT_SIZE])
{
inti,j,n; for(i=0; i<n; i++)
{
for(j=0; j<(n+1); j++)
{
printf("%f : ", mat[i][j]);
printf("\n");
}
}}
}