Question: Write a program that reads the input repeatedly using a for loop, and then prints the sum of the even and odd integers separately. Note:
Write a program that reads the input repeatedly using a for loop, and then prints the sum of the even and odd integers separately.
Note:
It can get only integer input, any number of inputs are allowed
It should print the sum of even number in the given input and sum of odd numbers in the given input separately
Output:
For the input
sum of even: sum of odd:
Note:
You have to find the summation of all numbers between to given input
You have to use for loop to solve this problem.
You can use the range function to iterate through loop until the given number
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
