Question: THIS IS C++ Will leave a like! Write a program that inputs positive and negative integers. The program calculates the sum of positive and negative
THIS IS C++ Will leave a like! Write a program that inputs positive and negative integers. The program calculates the sum of positive and negative integers separately. The program also prints how many of these numbers were entered. The user enters 0 to terminate the program.
Sample output1:
Type an integer (0 to stop): 6 Type an integer (0 to stop): -3 Type an integer (0 to stop): 7 Type an integer (0 to stop): -1 Type an integer (0 to stop): 9 Type an integer (0 to stop): 41 Type an integer (0 to stop): 0 Number of positive integers: 4 Sum of positive integers: 63 Number of negative integers: 2 Sum of negative integers: -4
Sample output2:
Type an integer (0 to stop): 0 Number of positive integers: 0 Sum of positive integers: 0 Number of negative integers: 0 Sum of negative integers: 0
Submit file name: sumposneg.cpp
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
