title: Java Pattern (numbers)
body: <p>How to print the following pattern:</p>
  
  <pre><code>1
  2  3
  4  5  6
  7  8  9  10
  11 12 13 14 15
  </code></pre>
  
  <p>I have tried this:</p>
  
  <pre><code>/**
   * Write a description of class Program89 here.
   * 
   * @author (your name) 
   * @version (a version number or a date)
   */
  public class Program91
  {
     public static void main()
     {
         int z=1;
         for(int x=1;x&lt;=5;x++)
         {
             for(int y=1;y&lt;=z;y++)
             {
                 System.out.print(z);
                 z++;
             }
              System.out.println();
         }
      }
  }
  </code></pre>
  
  <p>I tried but i got a never ending loop... Plz help...</p>
  
  <p>EDIT:</p>
  
  <p>I got it, I should have replaced z in for(int y=1;y&lt;=z;y++) with x...</p>