Computer Science, asked by rupanshikatoch, 5 months ago

write a program to calculate and display the sum of all odd numbers. and even numbers between a range of numbers from m to n where m<n input m and n​

Answers

Answered by masoommishra
1

Answer:

Take the number N upto which we have to find the sum as input.

2. Using for loop take the elements one by one from 1 to N.

3. Using if,else statements separate the element as even or odd.

4. Add the even and odd numbers separately and store it in different variables.

5. Print the sum separately and exit.

Similar questions