Skip to content

Commit a4b982f

Browse files
Merge pull request #188 from ShrutiPandey27/patch-1
Create Star pattern printing
2 parents 03a5d4b + ed1b86c commit a4b982f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Star pattern printing

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
public class Edureka
2+
{
3+
public static void pyramidPattern(int n)
4+
{
5+
for (int i=0;i<n;i++)//outer loop for number of rows
6+
{
7+
for (int j=n-i;j>1;j--)//inner loop for number of column
8+
{
9+
System.out.print(" ");
10+
}
11+
for(int j=0;j<=i;j++)
12+
{System.out.print("*");
13+
}
14+
System.out.println();
15+
}
16+
}
17+
public static void main (String args[])
18+
{
19+
int n=5;
20+
pyramidPattern(n);
21+
}
22+
}
23+

0 commit comments

Comments
 (0)