My code:
#include
using namespace std;
int main() {
int n,sum=0;
cin>>n;
sum+=n;
while(sum>=0)
{
cout<<n<<endl;
int n;
cin>>n;
sum+=n;
}
return 0;
}
I m getting an error that cin and cout are not declared in the scope but when i copied the same code in coding blocks online ide, i m getting correct answer . why so?