Q. Write a python program that accepts two integers from the user and print a message saying if first number is divisible by second number or if it is not.


You can understand by Watching video :-



Answer :-

first = int(input("Enter the first number "))
second = int(input("Enter the second number "))

if first % second == 0 :
    print ("first number is divisible by second number ")

else :
    print ("first number is not divisible by second number ")

Output :-

Enter the first number 4
Enter the second number 2
first number is divisible by second number

>>> 

Enter the first number 455
Enter the second number 2
first number is not divisible by second number

>>> 

Enter the first number 5563
Enter the second number 563
first number is divisible by second number

>>>


Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post