Write a program on following pattern :-
15 14 13 12 11
10 9 8 7
6 5 4
3 2
1
15 14 13 12 11
10 9 8 7
6 5 4
3 2
1
import
java.io.*;
class
Pattern
{
public
static
void
main(String args[])
{
int
a =
15
;
for
(
int
i =
5
; i>=
1
; i--)
{
for
(
int
j =
1
; j<=i; j++)
{
System.out.print(a+
"\t"
);
a--;
}
System.out.println();
}
}
}
No comments:
Post a Comment