this question deals with taking unknown input. how to do it.
Many things are not described
@robinkumar,
Answer to the question is present in the question itself, as it said print the numbers till you get positive cumulative sum, so you need to take input till you get the positive cumulative irrespective of the number inputs.
Algo:
- Put a loop till the END OF INPUT.
- Add the new number to the previous sum.
- If the sum is positive print the current number.
- Otherwise, break the loop.