Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started