Computer Science, asked by vinijoshi441, 10 months ago

Write a program to find a no. Is divisible by 5 and 11 in python

Answers

Answered by brandonsamjames
0

Answer:

Explanation:

n=int(input("enter the integer")

if n%5==0 and n%11==0

       print(n,"is divisible by 5 and 11")

else:

       print(n,"is not divisible by 5 and 11")      

#this will give you the answer to your question

#on a quick note the guy named vaibhu3301r who has answered your question has not done it for 5 and 11 together and he has used the list value "eval" instead of "int" for the variable which is a mistake

Answered by Equestriadash
6

The following codes will have to be typed in script mode, saved and then executed.

Here, we'll be using the IF - ELSE function. It is a function that decides the result based on a given condition.

It will run the body of the code, only if the condition is true. Otherwise, the 'else' code of the value inputted will be executed.

CODE:

x = int(input("Enter a number:"))

if (x%5 == 0) and (x%11 == 0):

   print("The number you entered is divisible by 5 and 11.")

else:

   print("The number you entered isn't divisible by 5 and 11.")

OUTPUT:        

Attachments:
Similar questions