Simple input (getting started with programming 2)

#include
using namespace std;
int main() {
int n;
int sum=0;
while(sum>=0)
{
cin>>n;
sum=+n;
if(sum<0)
{
break;
}
cout<<n<<endl;
}

return 0;

}
this is my code my output is correct but still my 2 test cases are not running please help me in this

Hey @gandhivaibhav01_1acde66cce1e5144 please write sum += n. I don’t know how rest 2 run successfully but arthmetic opertion comes before equal to sign.

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.