from loop to Nested loops?
<p>I have this program that returns a factorial of N.  For example, when entering 4,,, it will give  1! , 2! , 3!</p>

<p>How could I convert this to use nested loops?</p>

<pre><code>public class OneForLoop
{   
    public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);     
        System.out.print("Enter a number : ");
        int N = input.nextInt();                
        int factorial = 1;   

        for(int i = 1; i &lt; N; i++)
        {
             factorial *= i;         
             System.out.println(i + "! = " + factorial); 
        }         
    }
}
</code></pre>
