+ 2
JAVA question to find all the duck numbers from 1 to n
Guys, I need some help!! Please help me in telling me only the loop part(the complete nested loop part) for finding all the duck numbers 1 to n(number entered by the user). 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. Thanks in advance!
3 ответов
+ 3
Right man!
Thanks @3xhaust!
+ 2
Just did the code, check it out:
https://code.sololearn.com/cUU741UcM35W/#java
+ 1
i would give you a hint: use a while loop (that checks if a number is a duck number) inside a for loop(that runs from 1 to n)