Given a number N. The task is to check if the sum of digits of the given number divides the number or not. If it divides it then print YES otherwise print NO.
Input : N = 12 Output : YES Sum of digits = 1+2 =3 and 3 divides 12. So, print YES. Input : N = 15 Output : NO
Extract digits of the number and calculate the sum of all of its digits and check if the sum of digits dives N or not.
Below is the implementation of the above approach:
- Check if a given number divides the sum of the factorials of its digits
- Check whether product of digits at even places is divisible by sum of digits at odd place of a number
- Check if the sum of digits of number is divisible by all of its digits
- Check if a M-th fibonacci number divides N-th fibonacci number
- Check if two numbers have same number of digits
- Check if the given decimal number has 0 and 1 digits only
- Check if a number has digits in the given Order
- Check if all digits of a number divide it
- Check if the Xor of the frequency of all digits of a number N is zero or not
- Check if the frequency of all the digits in a number is same
- Check if a number with even number of digits is palindrome or not
- Check if a number is magic (Recursive sum of digits is 1)
- Check whether sum of digits at odd places of a number is divisible by K
- Program to check if a given number is Lucky (all digits are different)
- Program to check if a number is divisible by any of its digits
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.