title: print factorial calculation process in java
body: <p>Hi I need to print process of factorial calculation.
  E.g. If the user's input is 5, the system should print out "5 * 4 * 3 * 2 * 1 = 120"</p>
  
  <p>I have this code:</p>
  
  <pre><code> public static void factorial()
  {
      Scanner sc = new Scanner(System.in);
      int factorial = 1;
      int count;
  
      System.out.println(me+", This is option 2: Calculate a factorial");
      System.out.print("Enter your number: ");
      int number = sc.nextInt();
      System.out.println();
  
      if (number&gt;0)
          {
              for (count=1; count&lt;=number; count++)
  
              factorial = factorial*count;
  
              System.out.println(" = "+factorial);
              System.out.println();
          }
      else
      {
          System.out.println("Enter a positive whole number greater than 0");
          System.out.println();
      } 
  
  }    
  </code></pre>
  
  <p>I have tried insert this code:</p>
  
  <pre><code> System.out.print(count+" * ");
  </code></pre>
  
  <p>But the output is "1 * 2 * 3 * 4 * 5 *  = 6". So the result is wrong too.
  How can I change the code?
  Thanks</p>