The math teacher of class 7 f has tasked the students with writing a program in python to find out whether a given number is divisible by 3 or not. How should they proceed?
Answers
Answered by
0
Answer:
Divisibility by 7 can be checked by a recursive method. A number of the form 10a + b is divisible by 7 if and only if a – 2b is divisible by 7. In other words, subtract twice the last digit from the number formed by the remaining digits. Continue to do this until a small number.
Answered by
0
Answer:
Example:
Input: N = 12
Output: YES
Explanation:
As sum of digits of 12 = 1 + 2 = 3
and 12 is divisible by 3
So the output is YES
Input: N = 123
Output: NO
Explanation:
mark me asbrainliest
Similar questions