title: How can i print a triangle with "*"s using for loop in java?
body: <p>I want to draw a triangle with stars like below using for loop, but i really don't have any idea of how to do this ? Triangle is going to be like this: </p>
  
  <pre><code>*
  **
  ***
  ****
  *****
  ******
  *******
  ********
  *********
  **********
  </code></pre>
  
  <p>and so on. Can anybody please help me ? </p>
  
  <pre><code>public class Project1 {
      public static void main (String[] args){
          int c, d, e;
          for (c = 1 ; c &lt;= 8 ; c++){
              for (d = 1 ; d &lt;= c ; d++){
                  System.out.print ("*");
              }
              System.out.println("");
          }
  
          for (e = 1 ; e &lt;= 4 ; e++){
              System.out.println ("***");
          }
      } 
  } 
  </code></pre>
  
  <p>This is what i have found from the internet, but i did not understand the reason why it uses two loops. ( i understood the one used to construct the stem. ) </p>