Skip to content

Commit 0d8b32d

Browse files
committed
Initial commit
1 parent 8311a0e commit 0d8b32d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Pattern-2/Parallelogram_Pattern.java

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
Write a program to print parallelogram pattern for the given N number of rows.
3+
For N = 4
4+
****
5+
****
6+
****
7+
****
8+
*/
9+
10+
import java.util.*;
11+
12+
public class Parallelogram_Pattern {
13+
public static void main(String[] args) {
14+
// Write your code here
15+
Scanner sc = new Scanner(System.in);
16+
int row = sc.nextInt();
17+
18+
for (int i = 1; i <= row; i++)
19+
{
20+
for (int j = 2; j <= i; j++)
21+
{
22+
System.out.print(" ");
23+
}
24+
for (int j = 1; j <= row; j++)
25+
{
26+
System.out.print("*");
27+
}
28+
System.out.println();
29+
}
30+
31+
}
32+
33+
}

0 commit comments

Comments
 (0)