I have a file has thousands of rows and each row has a number and the number can be positive or negative. I want to do the cumulative sum from the first row. How can I find out the maximum cumulative value when I do the sum work row by row. Here is the example:
4
-3
2
-3
-1
1
In this case, the maximum cumulative value is 3 which is from adding the first 3 rows numbers (4, -3 and 2)
Thank you very much
Is this a homework assignment? Homework and coursework questions can only be posted in the homework and coursework forum with a completely filled out questionnaire from the homework rules.
If this is homework, please refile in the proper forum with a completely filled out template. If it is not homework, please explain what the purpose is for this problem.
And why do you think the maximum cumulative value is 3 when the accumulated value after reading the first line is 4?
This is not homework or assignment. I am doing some accounting work (many transaction) to report the highest balance on the banking account and the bank statement didn't provide the cumulative balance number to me, so I have to figure out a way to find it.
The reason I didn't count the first row because the adding work doesn't start. I don't do code work so I posted a help on this forum probably I posted the wrong place. Sorry.