Tuesday, July 28, 2009

Can someone please send me a program to add the diagonals of matrices in "C" language ? Please send me asap.

Please send me an easy program to add the diagonals of matrices in "C" language.Send it as soon as possible.I need it within 3 hours.Thanks.

Can someone please send me a program to add the diagonals of matrices in "C" language ? Please send me asap.
int trace(int matrix[][],int numrows,int numcols)


{





int tracetotal = 0;





if (numcols != numrows)


{


printf("Error: Can't compute trace. Not square matrix.\n");


exit(1);


}





for (int i = 0; i %26lt; numrows; i++)


{


tracetotal+=matrix[i][i];


}





return tracetotal;


}


No comments:

Post a Comment