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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program to check whether the given number is Buzz Number or not
- Check whether a given number N is a Nude Number or not
- Check whether a given number is an ugly number or not
- Check whether the number formed by concatenating two numbers is a perfect square or not
- Python program to check whether a number is Prime or not
- Check whether the binary equivalent of a number ends with given string or not
- C Program to check whether a number is a Perfect Cube or not
- Check whether Strings are k distance apart or not
- Check whether K-th bit is set or not
- Check whether a given string is Heterogram or not
- Check whether triangle is valid or not if sides are given
- Check whether a point lies inside a sphere or not
- Check whether the vowels in a string are in alphabetical order or not
- Check whether count of distinct characters in a string is Prime or not
- Check whether the frequencies of all the characters in a string are prime or not
- Check whether a + b = c or not after removing all zeroes from a,b and c
- Check whether two strings are equivalent or not according to given condition
- Check whether the Average Character of the String is present or not
- Check whether a Matrix is a Latin Square or not
- C++ program to check whether a String is a Pangram or not