New course! Every coder should learn Generative AI!
Try a free lesson+ 1
import java.util.*;
public class Program
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int r=0,g=1;
int n=sc.nextInt();
int num=n;
while(n!=0){
r=n%10;
if (r==0)
g=0;
n/=10;
}if (g==0)
System.out.println("The no. "+num+" is a duck umber ");
else
System.out.println("The no. "+num+" is not a duck number");
}
}