Improve Problem

In the problem the number of integers that should be inserted is not given, thereby complicating the process of applying loops for those who are approaching this problem from the array point of view.

Hi Ankush, in the problem it is given that you have to stop processing input after the sum becomes negative. So that means that there is never a fixed size of the input. Numbers will keep on coming but the program has to stop taking them input only after the sum of all previous elements becomes negative else keep on taking input.

@ankush.bhardwaj0 hey ankush this is running stream you are supposed to apply a loop in the loop you have to take input and this input will add up to a sum variable and you have to keep track to whether your commulative sum of n input should not be negative if it is happen you have to break the loop otherwise if sum is not negative you have to print your stream

Hey Ankush,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.