407946.1518280.qx3zqy7 Jump to level 1 Write a while loop that sums all integers read from input until a negative intege
Posted: Mon Jun 06, 2022 5:45 pm
407946.1518280.qx3zqy7 Jump to level 1 Write a while loop that sums all integers read from input until a negative integer is read. The negative integer should not be included in the sum. Ex: If input is 40 47 44 22 -10, then the output is: 153 1 #include <iostream> 2 using namespace std; 3 4 int main() { 5 int userNum; 6 int count; 7 8 count = 0; 9 cin>> userNum; 10 11 12 cout << count << endl; return 0; 13 14 15