title: How can I build a code that lists a string of factorials using only a for loop?
body: <p>I am relatively new to Java, as I am currently studying how to use for loops. How could I code a string of consecutive factorials strictly using a for loop?  For instance, I want to code up to 5 factorials in one single string- my issue is that my code only prints out 1 factorial.</p>
  <p>Input:</p>
  <pre><code>    int b = 1;
      int a = 1;
      for(int c = 1; c &lt;= b; c++)
      {
          a = a * c;
      }
      System.out.print(a);
  }
  </code></pre>
  <p>Expected output: 1 2 6 24 120</p>