using nested for loops statements to draw triangles of "*"s. The number of "*"s on the last row is input from the user (valid range: 5 to 21). the out put should look like this:
Sample output:

How many stars/last row (5-21)? 25 
Out of range. Reenter: 7

```
* 
** 
*** 
**** 
***** 
****** 
*******

```

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.

```
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<=5||rows>=21){
      System.out.println("Out of range. Reenter: ");
      rows=input.nextInt();
    }
    for(m=1;m<=rows;m++){
      for(c=1;c<=m;c++){
        System.out.println("*");
        System.out.println();
    }
  }
}
}

```