by CodeChum Admin
Do you still know what being divisible by a certain number means? In case you forgot, being divisible means that the number is capable of being divided by another number without a remainder. With this knowledge, you can surely solve this problem!
Instructions:
Input
A line containing an integer.
6
Output
A line containing a string.
Divisible·by·3
num = int(input("Enter an integer: "))
Flag=0
if(num%3==0): Flag=1
if(num%4==0): Flag=2
if(num%3==0 and num%4==0): Flag=3
if(Flag==1):
print("Divisible by 3")
if(Flag==2):
print("Divisible by 4")
if(Flag==3):
print("Divisible by 3 and 4")
Comments
Leave a comment