problem no.3
- write a program using two dimentional arrays that
compute
the sum of data in rows and sum of data in columns of
the 3*3 array variable.
sample input/output dialog
5 9 8 = 22
3 8 2 = 13
4 3 9 = 16
_____________
12 20 19
Answer Posted / maddy
/*the snippet for the problem is consider arr[10][10],read
the co-ordinates from the user col[10],row[10]*/
for(i=0;i<n;i++)//where n is co-ordinte
{
for(j=0;j<n;j++)
{
row[i]+=arr[i][j];//getting each element in the row
col[i]+=arr[j][i];//getting each element in column
}
}
Is This Answer Correct ? | 12 Yes | 4 No |
Post New Answer View All Answers