
Unformatted text preview: sum = 0; count = 0; cout << "Enter first number (negative to stop): "; cin >> num; while (num >= 0) { sum = sum + num; count = count + 1; cout << "Enter next number (negative to stop): "; cin >> num; } // compute and display average avg = (float) sum / (float) count; cout << endl << endl; cout << "The average is " << avg << endl; return 0; }...
View
Full Document
- Fall '08
- HARDWICK
- Computer Science, Rensselaer Polytechnic Institute Spring, count numbers sum, list int sum, Studio 13 Solutions, list int count
-
Click to edit the document details