- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA915.java
More file actions
Latest commit
37 lines (33 loc) · 612 Bytes
/
Copy pathA915.java
File metadata and controls
37 lines (33 loc) · 612 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
classA915
{
publicstaticvoidmain(String[] args)
{
System.out.println("this program will PRINT patter of given Character ARRAY");
inta[] = {'D','I','N','G','A','A'};
inty = 0;
for (inti=0;i<a.length ;i++ )
{
intl = y;
for (intj=0;j<a.length ;j++ )
{
if (i+j>=a.length-1)
{
System.out.print((char)a[l--]);
}
else
{
System.out.print(" ");
}
}
for (intk=0;k<a.length ;k++ )
{
if (i>=k+1)
{
System.out.print((char)a[(l++)+2]);
}
}
System.out.println();
y++;
}
}
}