Skip to content

Commit 2037019

Browse files
author
codehouseindia
authored
Merge pull request codehouseindia#120 from Deep22T/master
Create Reversed Pyramid Star Pattern
2 parents a45d4d4 + 1122cad commit 2037019

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Reversed Pyramid Star Pattern

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import java.util.Scanner;
2+
public class Pattern
3+
{
4+
public static void main(String[] args)
5+
{
6+
Scanner sc = new Scanner(System.in);
7+
System.out.println("Enter the number of rows: ");
8+
9+
int rows = sc.nextInt();
10+
for (int i= 0; i<= rows-1 ; i++)
11+
{
12+
for (int j=0; j<=i; j++)
13+
{
14+
System.out.print(" ");
15+
}
16+
for (int k=0; k<=rows-1-i; k++)
17+
{
18+
System.out.print("*" + " ");
19+
}
20+
System.out.println();
21+
}
22+
sc.close();
23+
24+
}
25+
}

0 commit comments

Comments
 (0)