Skip to content

Commit 5343a08

Browse files
committed
demo program (* patter) in java
1 parent a586f42 commit 5343a08

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

demo.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
1-
public class demo
2-
{
3-
public static void main(String[] args)
4-
{
5-
for(int i=0;i<5;i++)
6-
{
7-
for(int j=0;j<3;j++)
8-
{
9-
if(((i+2)%2==0 && j==0) || ((i+2)%2==0 &&j==2))
10-
{
11-
System.out.print(" ");
12-
}
13-
else
14-
{
15-
System.out.print("*");
1+
public class demo {
2+
public static void main(String[] args) {
3+
for (int i = 0; i < 5; i++) {
4+
for (int j = 0; j < 3; j++) {
5+
if (((i + 2) % 2 == 0 && j == 0) || ((i + 2) % 2 == 0 && j == 2)) {
6+
System.out.print(" ");
7+
} else {
8+
System.out.print("*");
169
}
1710

1811
}
1912
System.out.println();
2013

21-
2214
}
2315
}
2416
}

0 commit comments

Comments
 (0)