diff --git a/Patterns/Aaryan0424.java b/Patterns/Aaryan0424.java new file mode 100644 index 00000000..6091bbec --- /dev/null +++ b/Patterns/Aaryan0424.java @@ -0,0 +1,27 @@ +public class PyramidPattern +{ +public static void main(String args[]) +{ +//i for rows and j for columns +//row denotes the number of rows you want to print +int i, j, row = 6; +//Outer loop work for rows +for (i=0; i1; j--) +{ +//prints space between two stars +System.out.print(" "); +} +//inner loop for columns +for (j=0; j<=i; j++ ) +{ +//prints star +System.out.print("* "); +} +//throws the cursor in a new line after printing each line +System.out.println(); +} +} +}