Q:

Write a python program to read three numbers (a,b,c) and check how many numbers between ‘a’ and ‘b’ are divisible ‘c’

0

Write a python program to read three numbers (a,b,c) and check how many numbers between ‘a’ and ‘b’ are divisible ‘c’

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

a=int(input('enter number a: '))
b=int(input('enter number b: '))
c=int(input('enter number c: '))
counter_divisable=0
for i in range(a+1,b):
    if i%c==0:
        counter_divisable=counter_divisable+1
print('number of divisible numbers are: ',counter_divisable)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now