title: creating number patterns in java(continued)
body: <p>I need to create these patterns in java according to however many lines the user enters:</p>
  
  <p>1<br>
  12<br>
  123<br>
  1234<br>
  12345  </p>
  
  <p>54321<br>
  4321<br>
  321<br>
  21<br>
  1  </p>
  
  <p>12345<br>
  1234<br>
  123<br>
  12<br>
  1  </p>
  
  <p>I can do the first two but I cannot do the third.  I also need a space between each number.  Please help!</p>
  
  <p>Here is the code I used for the first:</p>
  
  <p>public static void displayPatternI (int lines) {</p>
  
  <pre><code>    for (int i = 1; i &lt;= lines; i++){
          for (int j = 1; j &lt;= i; j++)
              System.out.print (j + " " );
          System.out.println();
      }
  }
  </code></pre>
  
  <p>EDIT:
  this is the code for the second pattern:</p>
  
  <p>for (int i = 1; i &lt;= lines; i++){
      for (int j = lines + 1 - i; j > 0; j--)
             System.out.print (j + " ");
               System.out.println();</p>
  
  <p>I have tried modifying the first code extensively but I cannot get the third pattern...</p>