Please , I need some help to add the elements of a matrix.
my program must read several matrices from a file and add all element for each matrix.
This is how I did it
I initialized sum BEFORE the while loop (which is set to read all matricces unitil the end of file).Code:for(i=0;i<size;i++) { for(j=0;j<size;j++) sum=sum+A[i][j]; }
size is the size of the matrix.
I get wrong results.
can someone tell me what I am doing wrong?
thank you
B