Sir/Mam this question cannot be done as, there is nothing given to terminate the loop. How can the editor know when we have ended the input and that it should start giving us output.
If there is some other method to do this please do tell me
Sir/Mam this question cannot be done as, there is nothing given to terminate the loop. How can the editor know when we have ended the input and that it should start giving us output.
If there is some other method to do this please do tell me
An integer n should have been given regarding how many inputs we are giving and all
hello @kshitijsrc
in the question u are given that u need to read and print numbers only till the cummulative sum is positive,
so u can use while loop to print the numbers without knowing the number of inputs.
check this for clarity->
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us 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.