Skip to content

Write a Python program to find sum of all odd numbers between 1 to n.

PYTHON

Write a Python program to find sum of all odd numbers between 1 to n.

n = int(input("Enter the Starting number :- ")) m = int(input("Enter the Ending number :- ")) odd = 0 while n< m: if n % 2!=0: odd = odd + n n=n+1 print("The number is Even....",odd)

OUTPUT…