A Duck number is a number which has zeroes present in it, but there should be no zero present in the beginning of the number. For example 3210, 8050896, 70709 are all duck numbers whereas 02364, 03401 are not.
The task is to check whether the given number is a duck number or not.
Input : 707069 Output : It is a duck number. Explanation: 707069 does not contains zeros at the beginning. Input : 02364 Output : It is not a duck number. Explanation: in 02364 there is a zero at the beginning of the number.
It is a duck number.
This article is contributed by Nikita Tiwari. 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 write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Check if a number is divisible by all prime divisors of another number
- Check if a number has same number of set and unset bits
- Program to check whether a number is Proth number or not
- Check if a number with even number of digits is palindrome or not
- Program to check whether the given number is Buzz Number or not
- Check if a number is Triperfect Number
- Check if a given number is factorial of any number
- Check if a number is a power of another number
- Check if a number is Flavius Number
- Check whether the given number is Euclid Number or not
- Check if a number is a Krishnamurthy Number or not
- Check whether a number is Non-hypotenuse number
- Check if a number is a Mystery Number
- Check if a number is a Trojan Number