How to write a program to calculate and display sum in two dimensional array
I have a college tutorial question that required me to write a program which need to calculate and display the sum of each column of a two dimensional array. For example, in the following array
2 6 -1 5
8 2 7 -5
1 0 4 4
the method shoudl display the following
The sum of column 0 is 11
The sum of column 1 is 8
The sum of column 2 is 10
The sum of column 3 is 4
Assume that in the calling program the array A is declared as float A[MAXROW][MAXCOL]; where MAXROW and MAXCOL are global int constants.
The method should have a two dimensional array as its only parameter and shold not return any values.
I have roughly wrote something on a paper, but i jst dun get the idea how to link all the tings 2gether, can anyone pls help me of this? somone jst try to write tis program and giv me example wil do... :)