Search This Blog

Wednesday 19 October 2016

TO FIND PRODUCTS OF DIGITS


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);
    }
}

No comments:

Post a Comment

Make a JAVA program for a Toystore. This program suggest the toy based on the inputs users gives like age , gender , etc

 //editor used - IntelliJ IDEA package ToyStore; import javax.swing.*; import java.awt.event.*; import java.util.Scanner; //here you can edi...