Question: [C++] Write a program that reads in ten whole numbers and then outputs the sum of all the odd numbers, the sum of all the

[C++]

Write a program that reads in ten whole numbers and then outputs the sum of all the odd numbers, the sum of all the even numbers, and the sum of all numbers, whether even or odd. The user enters the ten numbers just time each and they can be entered in any order. Your program should not ask the user to enter the even and odd numbers separately. You MUST use a loop in this program. Use an integer for input. Note, use value%2 to determine if the number is even or odd. The mod 2 (%2) returns a zero or one depending on whether the number is even (value%2 == 0) or odd (value%2 == 1).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!