- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA8G.java
More file actions
Latest commit
24 lines (23 loc) · 393 Bytes
/
Copy pathA8G.java
File metadata and controls
24 lines (23 loc) · 393 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
classA8G
{
publicstaticvoidmain(String[] args)
{
intn = 5;
// Printing G pattern
for (inti=0;i<n ;i++ )
{
for (intj=0;j<n ;j++ )
{
if (i==0 || (i==4 && j<4) || j==0 || (j==3 && i>=2) || (i==2 && (j>1 && j<=4)))
{
System.out.print("*");
}
else
{
System.out.print(" ");
}
}
System.out.println();
}
}
}