title: Using loops to compute factorial numbers, Java
body: <p>I'm trying to compute the value of 7 factorial and display the answer, but when I tried to look up a way to do this I kept finding code that was written so that a number first had to be put in from the user and then it would factor whatever number the user put in. But I already know what number I need, obviously, so the code is going to be different and I'm having trouble figuring out how to do this.</p>
  
  <p>I tried this at first</p>
  
  <pre><code>public class Ch4_Lab_7 
  {
      public static void main(String[] args)
      {
          int factorial = 7;
          while (factorial &lt;= 7)
          {
          if (factorial &gt; 0)
          System.out.println(factorial*facto… 
          factorial--;
          }
      }
  }
  </code></pre>
  
  <p>But all it does is display 7*7, then 6*6, then 5*5, and so on, and this isn't what I'm trying to do. 
  Does anyone know how to do it correctly?</p>