Skip to content

Commit 241930d

Browse files
authored
Print star pattern on own
Printing Star Pattern in series fashion
1 parent 7af6a7e commit 241930d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

startpatternfunc.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
public class startpatternfunc {
2+
static void star(int n){
3+
for(int i=0;i<n;i++){
4+
for(int j=0;j<=i;j++){
5+
System.out.print("*");
6+
7+
}
8+
System.out.print("\n");
9+
10+
}
11+
}
12+
13+
static void starrev(int n){
14+
for(int i=n-1;i>=0;i--){
15+
for(int j=0;j<=i;j++){
16+
System.out.print("*");
17+
18+
}
19+
System.out.print("\n");
20+
21+
}
22+
}
23+
24+
25+
public static void main(String[] args) {
26+
star(3);
27+
starrev(3);
28+
}
29+
}

0 commit comments

Comments
 (0)