Write a python program to calculate the sum of numbers from m to n.

                            Write a python program to determine whether a person is eligible to vote. 

Write a python program to calculate the sum of numbers from m to n.

PROGRAM:

m=int(input("Enter m value:"))

n=int(input("Enter n value:"))

i=0

while (m<=n):

    i=i+m

    m=m+1

    print("Sum= ",i)

OUTPUT:

Sum=  42

No comments:

Post a Comment




Copyright Ⓒ 2022 | Mechpedia | All Right Reserved.