How do you some a row and column of 2D arrays?

closed account (LN3RX9L8)
For example If I have the following
how would I sum each row and column ??

For example

1 2 3 4 5
0 1 3 8 9
Using loops
1
2
3
for(int i = 0; i < rows; ++i
    for(int j = 0; j < cols; ++j)
        total += matrix[i][j];


In the future please don't open duplicate topics.
closed account (LN3RX9L8)
Thanks, and are you the owner of this website?
closed account (D80DSL3A)
@Tiffany143 (aka Pidge143) This site is largely moderated by its members, who have been quite tolerant of your forum spamming.

Why the attitude?
closed account (LN3RX9L8)
I don't have an attitude I am nice, but you guys always are the ones telling me mean things, and if I say something you say something rude... I am just a beginner and I receive rude things on this website on a daily basis when I just need help
What they are trying to tell you is, it will not help if you try to post same question again and again.

Also, making several profiles to get responses quickly will also not work.

People here answer because they love it and not because we are getting paid. So, just post once and as soon some will see your post and likes it, will surely post the answer/suggestion.
Posting again and again pisses people and they will stop replying to you.
I was not rude, I said please,
Topic archived. No new replies allowed.