Here is the code I have written for the question
#include
using namespace std;
int main()
{
int n;
cin >> n;
int a;
int sum =0;
for (int i=1;i<=n;i++)
{
cin >> a;
sum = sum + a;
}
while (sum >=0)
{
cout << a << endl;
}
return 0;
}
After inputting the numbers I am not getting anything back,the compilation process ends.Please explain what I am doing wrong