Divisibility of Numbers
Let a and b be the two numbers.
Divisibility says that b can completely divides a if their remainder is Zero.
i.e. a%b=0
Program:
In this program, we will check the divisibility of numbers by applying simple formula given above.
#Program: To check divisibility of two numbers
#Author: Hitendra E. Suryavanshi
a=int(input("Enter a number"))
b=int(input("Enter a number"))
if a%b==0:
print("a is fully divisible by b")
else:
print("a is not fully divisible by b")
Output 1:
Output 2:
Thank You
Hitendra E. Suryavanshi
M.Tech.(IT), BE (IT)
Let a and b be the two numbers.
Divisibility says that b can completely divides a if their remainder is Zero.
i.e. a%b=0
Program:
In this program, we will check the divisibility of numbers by applying simple formula given above.
#Program: To check divisibility of two numbers
#Author: Hitendra E. Suryavanshi
a=int(input("Enter a number"))
b=int(input("Enter a number"))
if a%b==0:
print("a is fully divisible by b")
else:
print("a is not fully divisible by b")
Output 1:
Enter a number10 Enter a number5 a is fully divisible by b
Output 2:
Enter a number7 Enter a number2 a is not fully divisible by b
Thank You
Hitendra E. Suryavanshi
M.Tech.(IT), BE (IT)
No comments:
Post a Comment