Does not work for all positive numbers

when i use the cummulative sum method for positive numbers. it doesnt work. for eg, if my input is 1,2,3,4,5. the maximum sum printed is 14 instead of 15.

@samikshamodi7 Hey Samiksha, I think you did some mistake while writting the code.

Please refer this Code : https://ide.codingblocks.com/s/77804

Please fell free to you ask your doubt if you don’t understand this code.

@samikshamodi7 Hey Samiksha, I hope I’ve cleared your doubt. Please mark this doubt as resolved and rate me on the basis of your experience. Rating option is just below where you mark this doubt as resolve. Your feedback is very important. It helps us to improve our platform and hence provide you the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen the doubt.