Print Star Pattern - 11 | Java Programs

Output:

*** Star Pattern 11 ***

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

Click Here For Java Online Compiler

Solution:

/**
 *
 * @author Alee Ahmed Kolachi
 */
public class StarPattern11 {

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

        for (int i = 5; i >= 1; i--) {
            for (int j = i; j >= 1; j--) {
                System.out.print(" *");
            }
            for (int j = 1; j <= space; j++) {
                System.out.print("  ");
            }
            for (int j = i; j >= 1; j--) {
                System.out.print(" *");
            }
            System.out.println();
            space = space + 2;

        }
    }
}
Share This :

Related Post



sentiment_satisfied Emoticon