Print Star Pattern - 1 | Java Programs

Output:

*** Star Pattern 1 ***

*
**
***
****
*****
******

Click Here For Java Online Compiler

Solution:

class StarPattern1 {
 public static void main(String args[]) {
  int rows = 6;
  System.out.println("*** Star Pattern 1 ***" + "\n");
  for (int i = 1; i <= rows; i++) {
   for (int j = 1; j <= i; j++) {
    System.out.print("*");
   }
   System.out.println();
  }
 }
}
Share This :

Related Post



sentiment_satisfied Emoticon