Computer Science, asked by iqbalmalik9, 2 days ago

Write a program to check whether a number is divisible by 7 or not.​

Answers

Answered by BeingBlank
0

Answer:

def isDivisibleBy7(num) :

if num < 0 :

return isDivisibleBy7( -num )

if( num == 0 or num == 7 ) :

return True

if( num < 10 ) :

return False

return isDivisibleBy7( num // 10 - 2 * ( num - num // 10 * 10 ) )

num = 616

if(isDivisibleBy7(num)) :

print ("Divisible")

else :

print ("Not Divisible")

Answered by wakchaureasha85
0

Answer:

the difference between twice the unit digit of the given number and the remaining part of the given number should be a multiple of 7 or it should be equal to 0

Explanation:

pls mark as brainlist

Similar questions