title: Multiplying digits of a number until you reach a one digit number
body: <p>Assume, you input the number 546, then you should find the product of its digits, which is 5<em>4</em>6=120, then multiply the digits of 120 until and so on, continue until you get a one digit number.
  Here's the code I wrote, but the loop doesn't work correctly and I've tried to fix it, but nothing changed. Could you please help me?</p>
  <pre><code>import java.util.*;
  public class Product {
      public static void main(String[] args) {
          Scanner keyboard = new Scanner(System.in);
          int a = keyboard.nextInt();
          System.out.println(&quot;Please input the number&quot;);
          numberOfProducts(a);
  
  
      }
      public static void numberOfProducts(int n){
          int product = 1;
          while(n&gt;10) {
              int current = n;
              while (current != 0) {
                  product = product * (current % 10);
                  current = current / 10;
                  n = product;
                  System.out.println(product);
              }
          }
  
      }
  
  }
  </code></pre>