write a C++ function to find the sum of diagonal
elements from a Two-dimensional array of tipe
float. Use the array and its size as parameter
with float as its return type
Answers
Answered by
7
Answer:
float diasum(float A[ ][ ],int R,int C)
{ int i,j;
float Dsum=0.0;
for(i=0;i<R;i++)
for(j=0;j<C;j++)
if((i= = j)| | (i+j)= =(size-1))
Dsum=Dsum+A[i][j];
return Dsum;
}
thank you........
Similar questions