title: Using nested for loops to create a triangle with asterisks
body: <p>using nested for loops statements to draw triangles of "<em>"s. The number of  "</em>"s  on the last row is input from the user (valid range: 5 to 21). the out put should look like this:
  Sample output:</p>
  
  <p>How many stars/last row (5-21)? 25 
  Out of range. Reenter: 7</p>
  
  <pre><code>* 
  ** 
  *** 
  **** 
  ***** 
  ****** 
  *******
  </code></pre>
  
  <p>so far this is what i have for the code. I don't know how to get it to look like a triangle. any help would be great.</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Lab7_2{
    public static void main(String[] args){
      //declarations
      Scanner input= new Scanner(System.in);
      int how_many;//num of triangles
      int m; //constant
      int c;//constant
      int rows;//row
  
      //prompt for input
      System.out.println("Drawing triangles program.");
      System.out.println("==============================");
      System.out.println("How many triangles?");
      how_many=input.nextInt();
      System.out.println("How many stars/last row (5-21)?");
      rows=input.nextInt();
      while(rows&lt;=5||rows&gt;=21){
        System.out.println("Out of range. Reenter: ");
        rows=input.nextInt();
      }
      for(m=1;m&lt;=rows;m++){
        for(c=1;c&lt;=m;c++){
          System.out.println("*");
          System.out.println();
      }
    }
  }
  }
  </code></pre>