Skip to content

Commit 5816861

Browse files
authored
Create Pattern8.java
1 parent 29d11a3 commit 5816861

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Pattern Programs/Pattern8.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
3+
Pattern 8
4+
5+
*
6+
* *
7+
* *
8+
* *
9+
*********
10+
11+
*/
12+
13+
14+
public class Pattern8 {
15+
16+
public static void main(String[] args) {
17+
for (int i = 1; i <= 5; i++) {
18+
for (int k = 1; k <= 6-i; k++) {
19+
System.out.print(" ");
20+
}
21+
for (int j = 1; j <= (2*i)-1; j++) {
22+
if(j==1 || j==(2*i)-1 || i==5) {
23+
System.out.print("*");
24+
}
25+
else {
26+
System.out.print(" ");
27+
}
28+
}
29+
System.out.println();
30+
}
31+
32+
}
33+
34+
}

0 commit comments

Comments
 (0)