A Duck number is a positive number which has zeroes present in it, For example 3210, 8050896, 70709 are all Duck numbers. Please note that a numbers with only leading 0s is not considered as Duck Number. For example, numbers like 035 or 0012 are not considered as Duck Numbers. A number like 01203 is considered as Duck because there is a non-leading 0 present in it.
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.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Check if a number is divisible by all prime divisors of another number
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Check if a number with even number of digits is palindrome or not
- Program to check whether a number is Proth number or not
- Check if the number is a Prime power number
- Check if a number has same number of set and unset bits
- Program to check whether the given number is Buzz 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 ends with another number or not
- How to check if a given number is Fibonacci number?
- Check whether given number N is a Moran Number or not
- Check if a number is Triperfect Number
- Check whether the given number is Euclid Number or not
- Check whether a given number N is a Nude Number or not
- Check if a number is an Achilles number or not
- Check if a number is a Mystery Number
- Check if a number is a power of another number
- Check if a number is a Trojan Number
- Check if a given number is factorial of any number