I need to understand a code for cumulative sum in 2D array in c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I need to understand a code for cumulative sum in 2D array in c++

a task is required from me I need a help

9th Apr 2017, 1:35 PM
Nehal
Nehal - avatar
5 Answers
+ 7
Use a for loop nested inside of a for loop. The outer for loop will be how many arrays are contained within the total array, and the second will be the number of elements in each array. If you are asked to do something, you shouldn't ask others to do it for you. You should research and try to figure it out yourself, because you are obviously expected to know how to do it.
9th Apr 2017, 1:38 PM
J.G.
J.G. - avatar
+ 7
Good that you tried, I can't really make a code out of your example, but I can make my own. (array defined as [3][4]) for(int i = 0; i <= 2; i++){ for(i = 0; i <= 3; i++){ System.out.println(array[i]); } }
9th Apr 2017, 1:48 PM
J.G.
J.G. - avatar
0
I really tried hard and searched for more than week I really did my best so I just need a little help to know how to think even. thank you .
9th Apr 2017, 1:42 PM
Nehal
Nehal - avatar
0
what this means System.out.println(array[i]); }
9th Apr 2017, 1:49 PM
Nehal
Nehal - avatar
0
I made it yeaaaaaaaa
9th Apr 2017, 2:07 PM
Nehal
Nehal - avatar