Https://online.codingblocks.com/player/21555/content/4627/4693

in this question it says stop processing after cumulative sum is negative, we have to use EOF here or not?

here is my code:

#include
using namespace std;
int main() {
int no,sum;
while(scanf("%d",&no)!=EOF && sum>0)
{
cout<<no<<endl;
sum=sum+no;

}
return 0;

}

@asifiqbal0419
simple apply a loop while(true)
{
cin>>n;
sum+n;
if(sum>=0){
cout<<n;
}
else{
break;
}
}

what will be the condition in this loop?
because you are already checking the sum>=0 inside the loop!

@asifiqbal0419 no condition is required because it is running stream it will automatically terminate after condition fails

https://ide.codingblocks.com/s/71697

it still shows error because while loop needs a condition without any condition it will show error!

@asifiqbal0419 just write true inside in the loop