title: having trouble printing a triangle using java
body: <p>I'm currently doing the "learn to program in java" course on edex.org.
  The problem I'm stuck on is the following:</p>
  
  <p>Write for loops to produce the following output in the shape of a triangle:</p>
  
  <p>1<br>
  22<br>
  333<br>
  4444<br>
  55555<br>
  666666<br>
  7777777</p>
  
  <p>this is my code: </p>
  
  <pre><code>for(int i=1; i&lt;=7;i++){
  
  for(int j=1; j&lt;=i;j++){
  
      if(i==j){
          System.out.print(i);
      }else{
  
      System.out.println();
     } 
      System.out.println(i);
  }
  </code></pre>
  
  <p>}</p>