Check Numbers Divisible by Another Number in Python

(Last Updated On: 22/11/2022)

Python Program to Check First Numbers Divisible by Another Number

# Python Program to Check First Numbers Divisible by Another Number

# we are taking a number from user as input
# entered value will be converted to int from string
numn = int(input("Enter a Number (Numerator): "))
numd = int(input("Enter a Number (denominator): "))

if numn%numd==0:
  print("\n" +str(numn)+ " is divisible by " +str(numd))
else:
  print("\n" +str(numn)+ " is not divisible by " +str(numd))

Output:

Enter a Number (Numerator): 60
Enter a Number (denominator): 10
60 is divisible by 10

Leave a Reply

Your email address will not be published. Required fields are marked *