public class digit_product
{
public static void digit_product(int n)
{
int p=1,i=1,r;
while(n>0)
{
r=n%10;
p=p*r;
n=n/10;
}
System.out.println("the product is "+p);
}
}
//editor used - IntelliJ IDEA package ToyStore; import javax.swing.*; import java.awt.event.*; import java.util.Scanner; //here you can edi...
No comments:
Post a Comment