Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions