Skip to content
This repository has been archived by the owner on Nov 10, 2021. It is now read-only.

Create Aaryan0424.java #562

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Patterns/Aaryan0424.java
Original file line number Diff line number Diff line change
@@ -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; i<row; i++)
{
//inner loop work for space
for (j=row-i; j>1; 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();
}
}
}