Question: Write a c + + program that uses while loops to perform the following steps: a ) Prompt the user to input two numbers, the

Write a c++ program that uses while loops to perform the following steps:
a) Prompt the user to input two numbers, the first number must be less than the second number.
b) Output all numbers between the first number and the second number (exclusive).
c) Compute and print the sum of all even numbers between the first and the second numbers.
d) Compute and print the sum of all odd numbers between the first and the second numbers.
e) Compute and print the average of even numbers and the average of odd numbers between the first and the
second numbers.
Input/output Samples
Enter two numbers, the first must be less than the second: 34
No numbers between 3 and 4
The sum of the even numbers is 0
The sum of the odd numbers is 0
No odd numbers between the given numbers.
No even numbers between the given numbers.
Enter two numbers, the first must be less than the second: 419
The sum of the even numbers is 84
The sum of the odd numbers is 77
The average of the odd numbers between 4 and 19 is 11
The average of the odd numbers between 4 and 19 is 12
 Write a c++ program that uses while loops to perform the

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!