write a program in java to print duck number
Answers
Answered by
3
Class duck
{
void main (int n)
{
int r , int e = 0;
while (n!=0)
{
r= n%10
n= n/10
if (r ==0)
c++
}
if (c>=1)
system.out.println ("duck number");
else
system.out.println ("not a duck number");
}
}
Answered by
6
Answer:
import java.util.*;
import java.util.*;class Duck
{
{public static void main()
{public static void main(){
Scanner sc=new Scanner (System.in);
{
int n,r,p,c=0;
System.out.println("Enter the number");
n=sc.nextInt();
while (n>0)
{
r=n%10;
if(r==0)
System.out.println("Duck number");
else
System.out.println("Not a Duck num');
}
}
}
Similar questions
Hindi,
1 month ago
Math,
1 month ago
Math,
1 month ago
Math,
2 months ago
Social Sciences,
9 months ago