title: How do I make it so the last multiplication sign is not included in the line of factorials?
body: <p>So I need to get rid of this final multiplication sign in each line. I've tried a few different ways but they just messed up my code or didn't work, and I can't seem to wrap my head around how to go about this. </p>
  
  <p><strong>Here's an example of the output:</strong></p>
  
  <pre><code>Starting value (at least 2): 
  59
  
  Ending value (at least 2): 
  64
  
  59 = 59 x 
  
  60 = 2 x 2 x 3 x 5 x 
  
  61 = 61 x 
  
  62 = 2 x 31 x 
  
  63 = 3 x 3 x 7 x 
  
  64 = 2 x 2 x 2 x 2 x 2 x 2 x 
  </code></pre>
  
  <p><strong>Here's how I want it to look:</strong></p>
  
  <pre><code>Starting value (at least 2): 
  59
  
  Ending value (at least 2): 
  64
  
  59 = 59 
  
  60 = 2 x 2 x 3 x 5 
  
  61 = 61 
  
  62 = 2 x 31 
  
  63 = 3 x 3 x 7 
  
  64 = 2 x 2 x 2 x 2 x 2 x 2 
  </code></pre>
  
  <p><strong>And here's the code:</strong></p>
  
  <pre><code>import java.util.Scanner;
  
  public class PrimeFact {
  
      public static void main(String[] args) {
          int start, stop;
          int number = 0;
  
          Scanner input = new Scanner(System.in);
          System.out.println("Starting value (at least 2): ");
          start = input.nextInt();
          System.out.println("Ending value (at least 2): ");
          stop = input.nextInt();
  
          // stops the program if the user entered n input that cannot be factored
          if (start &lt; 2 || stop &lt; 2) {
              System.out.println("Amount must be at least 2 rather than " + start + " and " + stop + ". Quitting.");
              System.exit(0);
          } // end if
  
          // loop
          // calls factors
          for (int i = start; i &lt;= stop; i++) {
              number = i;
              printFactors(i);
              System.out.println();
          } // ends loop
  
      }// ends main
  
      // prints prime factors
      public static void printFactors(int number) {
          int out = number;
          int count = 0;
          System.out.print(out + " = ");
          for (int factor = 2; factor &lt;= number; factor++) {
              int exponent = 0;
              while (number % factor == 0) {
                  number /= factor;
                  exponent++;
                  count++;
              }
              if (exponent &gt; 0) {
                  printExponents(exponent, factor, count);
  
              }
          }
      }
  
      //prints the factors the required number of times
      public static void printExponents(int exponent, int factor, int count) {
  
          for (int q = 1; q &lt;= exponent; q++) {
              System.out.print(factor + " x ");
              // if (q /= count) {
              // System.out.print(factor);
              // }
          }
      }
  
  }// ends class
  </code></pre>