Drawing shapes using java for loops - Stack Overflow

PHOTO EMBED

Mon Nov 09 2020 14:56:12 GMT+0000 (Coordinated Universal Time)

Saved by @Muhammadcodes #java

class TriangleDrawing{

    public static void main(String args[]){

        for(int x = 1; x <= 6; x++){

            for(int y = 1; y <= (6-x); y++){

                System.out.print(" ");

            }

            for(int z = 0; z < (x + (x-1)); z++){

                System.out.print("*");

            }

            for(int p = 1; p <= (6-x); p++){

                System.out.print(" ");

            }

            System.out.println();

        }

    }

}
content_copyCOPY

In the development of patterns using asterisks

https://stackoverflow.com/questions/29486087/drawing-shapes-using-java-for-loops