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
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