#include <iostream>
using namespace std;
int main()
{
int num = 0;
int sum = 0;
cout << “please put a number.” << endl;
cin >> num;
while(num>=0) {
sum += num;
cout << “sum=” << sum << endl << “try again” << endl;
cin >> num;
}
}
#include <iostream>
using namespace std;
int main()
{
int num = 0;
int sum = 0;
cout << “please put a number.” << endl;
cin >> num;
while(num>=0) {
sum += num;
cout << “sum=” << sum << endl << “try again” << endl;
cin >> num;
}
}