Question: Write a program that prompts the user for two integers x and y. Then compute the sum of the even integers and odd integers within
Write a program that prompts the user for two integers x and y. Then compute the sum of the even integers and odd integers within the range of x and y. Your program should output these two sum values. Display an error message and exit the program for the following input values: if x is less than 1 or if y is less than or equal to x.
Sample Output.
Enter x: 1
Enter y: 10
The sum of even integers between 1 and 10 = 30
The sum of odd integers between 1 and 10 = 25
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
