-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButerfly.java
More file actions
40 lines (36 loc) · 995 Bytes
/
Buterfly.java
File metadata and controls
40 lines (36 loc) · 995 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
public class Buterfly {
public static void main(String args[])
{ int a= 1;
int b= 9;
for(int i=1; i<11 ; i++)
{
if(i<6)
{
for(int j=1; j<i+1 ; j++){
System.out.print("@ ");
}
for(int k = a; k<9; k++){
System.out.print(" ");
}
for(int l=1; l<=i; l++){
System.out.print("@ ");
}
System.out.println();
a= a+2;
}
else{
for(int j=1; j<12-i ; j++){
System.out.print("@ ");
}
for(int k = b; k<9; k++){
System.out.print(" ");
}
for(int l=1; l<=11-i; l++){
System.out.print("@ ");
}
System.out.println();
b= b-2;
}
}
}
}