this matrix
0 2 2 4
0 2 2 1
8 6 0 3
should return the sum of 224+221+8603
this is a part of a code
why its not working??
Code:int power=1;
int coef=0;
for (index = 0; index < rows; index++)
{
for (kndex = 0; kndex < cols; kndex++)
{
for (z=0;z<(cols-kndex);z++){
pwer=pwer*10;
}
coef=matrix[index][kndex]*pwer;
tsum=tsum+coef;
}
}
printf("%d ",tsum);