Largest sum of given coloumn

I have a problem with getting the largest of the sum of every column in my array. What I need to do is get the total for every column, a[i][j], then display the largest.
You could put every sum into an array and then find the greatest value in that array, or you could
1
2
3
4
5
int max;
for(int c = 0; c < maximum number of columns; c++){
   int s = sum of elements in column c
   if(c == 0 || s > max) max = s;
}
Topic archived. No new replies allowed.