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 firstname.lastname@example.org. 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.
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- 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
- Program to check whether a number is Proth number or not
- Check if the number is a Prime power number
- Program to check whether the given number is Buzz Number or not
- Check if a number with even number of digits is palindrome or not
- Check if a number has same number of set and unset bits
- Check if a given number is factorial of any number
- Check whether given number N is a Moran Number or not
- Check whether a given number N is a Nude Number or not
- Check if a number is a power of another number
- Check if a number is Flavius Number
- Check if a number ends with another number or not
- Check whether a number is Non-hypotenuse number
- Check if a number is an Unusual Number or not