title: how to print a number triangle in java
body: <p>I need to produce a triangle as shown:</p>
  
  <pre><code>    1
     22
    333
   4444
  55555
  </code></pre>
  
  <p>and my code is:</p>
  
  <pre><code>int i, j;
  for(i = 1; i &lt;= 5; i++)
  {
      for(j = 1; j &lt;= i; j++)  
      {          
          System.out.print(i); 
      }      
      System.out.print("\n");        
  }
  </code></pre>
  
  <p>Producing a triangle the opposite way</p>
  
  <pre><code>1
  22
  333
  4444
  55555
  </code></pre>
  
  <p>What do i need to do to my code to make it face the right way?</p>