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.
Inputoutput Samples
Enter two numbers, the first must be less than the second:
No numbers between and
The sum of the even numbers is
The sum of the odd numbers is
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:
The sum of the even numbers is
The sum of the odd numbers is
The average of the odd numbers between and is
The average of the odd numbers between and is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
