Program in python to calculate the sum of odd numbers divisible by 5 from the range 1 to 100


Write a program in python to calculate the sum of odd numbers divisible by 5 from the range 1 to 100

----------------------------------

sum=0
for a in range (1,101,2):
    if a%5==0:
        sum=sum+a
print("Sum of odd numbers divisible by 5 from range 1 to 100 is : ",sum)

----------------------------------

Output:-

Sum of odd numbers divisible by 5 from range 1 to 100 is :  500

Post a Comment

0 Comments