title: Doing a factorial with only one while loop
body: <p>I'm trying to find the factorial of 9 down to 0, only using one while loop, but my idea isn't outputting a value. </p>
  
  <p>I figured out the way to do it using two while loops:</p>
  
  <pre><code>    int i;
      count = 9;
      while (count &gt;= 0){
          value = count;
          i = count-1;
          while (i &gt; 0){
              value = value * i;
              i--;
          }
          System.out.print(value + ", ");
      }
  </code></pre>
  
  <p>This worked but I've tried to change it to use only one while loop and got this:</p>
  
  <pre><code>    int i;
      for (count = 9; count &lt; 0; count--){
          value = count;
          i = count-1;
          while (i &gt; 0){
              value = value * i;
              i--;
          }
          System.out.print(value + ", ");
      }
  </code></pre>
  
  <p>I'm not completely sure if I'm using the for statement correctly but I think I am, or at least I think it should output something so I can debug it.</p>
  
  <p>Could someone give me a hint in the right direction?</p>