Header Ads Widget

Python program to check whether a number is divisible by 5 and 11 or not

 

 Python program to check whether a number is divisible by 5 and 11 or not

Given a number , write a program to check whether it is divisible by 5 and 11 or not .

Sample input

55 

Sample output

55 is divisible by both 5 and 11

Python program to check whether a number is divisible by 5 and 11 or not

The objective of the code is to find whether number is divisible by 5 and 11 or not .

Code(Python):-

a=int(input())
if a%5==0 and a%11==0:
print(f"{a} is divisible by both 5 and 11")
elif a%5==0:
print(f"{a} is divisible by 5 ")
elif a%11==0:
print(f"{a} is divisible by 11 ")
else:
print(f"{a} is not divisible by both 5 and 11 ")


Output:-

55
55 is divisible by both 5 and 11

Recommended Post :-

HCL Coding Questions:-

Capgemini Coding Questions:-

Companies interview:-

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-

Post a Comment

0 Comments