// Program to add numbers until a given sentinel is input. // Michael Rothstein // 06/19/2014 #include using std::cin; using std::cout; using std::endl; int main() { int total = 0; // Contains the sum of all read in numbers. int sentinel; cout << "What sentinel do you want to use?"; cin >> sentinel; while (1){ int number; cin >> number; if( number == sentinel ) break; total += number; } cout << "Sum is " << total << endl; }