// AddWhilePositive.cc // Computes the sum of numbers input at the keyboard. // The input is terminated when input number is negative. #include using namespace std; int main() { float number, total=0.0; cout << "Input numbers to be added: " << endl; cin >> number; // Stay in loop while input number is positive while(number >= 0.0) { total = total + number; cin >> number; } // Output sum of numbers cout << total << endl; return 0; }