Simple input-challenges

i am not able to run the code correctly…please help

@jhanvi_10 hey jhanvi this question have input given as running stream of numbers so can you please share your implementation so that I can help or suggest the changes .

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.

same i am also not getting this question.
#include
using namespace std;
int main(){
int a[10],sum=0,i=0;
cin>>a[0];
cin>>a[1];
cin>>a[2];
cin>>a[3];
i=0;
while(sum>=0 || i<4){
sum=sum+a[i];
if (sum<0){
break;
}
cout<<a[i]<<endl;
i=i+1;
}
}
this is what i did