Print Star Pattern - 2 | Java Programs

Output:

*** Star Pattern 2 ***

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

Click Here For Java Online Compiler

Solution:

class StarPattern2 {

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

Related Post



sentiment_satisfied Emoticon