Print Star Pattern - 6 | Java Programs

Output:

*** Star Pattern 6 ***

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

Click Here For Java Online Compiler

Solution:

/**
 *
 * @author Alee Ahmed Kolachi
 */
class StarPattern6 {

    public static void main(String args[]) {
        int rows = 6;
        System.out.println("*** Star Pattern 6 ***" + "\n");

        for (int i = rows; i >= 1; i--) {
            for (int j = rows; j > i; j--) {
                System.out.print(" ");
            }
            for (int k = 1; k < (i * 2); k++) {
                System.out.print("*");
            }
            System.out.println("");
        }
    }
}
Share This :

Related Post



sentiment_satisfied Emoticon