What is wrong in this solution of the question?

Given a list of numbers, stop processing input after the cumulative sum of all the input becomes negative.

Input Format
A list of integers to be processed

int main()
{

int i,n,a,b;
for(i=1,b=0;i>0;)
{
	
	cin>>n;
	a=b+n;
	if(a<=0)
	{
		break;
	}
	cout<<n<<endl;
	b=n;
}	

}

hi @gautamawesome09_5236247ed1771e11
I can see that u have successfully submitted the code and gained full points… is there still anything??

yess sorry i figured it out now
i was facing some problem earlier
thanks!

1 Like

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.