2.7k views
21 votes
Write a program to find the summation of the numbers from 5 to 15

1 Answer

6 votes

Answer:

See the code in the explanation section

Step-by-step explanation:

Note: the code below is writen in Python language

lower = int(input("Enter lower bound of range: "))

upper = int(input("Enter upper bound of range: "))

sum = 0

for i in range(lower, upper + 1):

sum = sum + i

i = i + 1

print("Sum is ", sum)