Question 18 : Write a program in Java to print the following pattern :
5
54
543
5432
54321
Java Program :
public class pattern_5
{
public static void main()
{
int i,j;
for(i=5;i>=1;i--)
{
for(j=5;j>=i;j--)
{
System.out.print(j);
}
System.out.print("\n");
}
}
}
I WANT A PROGRAM OF THIS AAS SSON AS POSSIBLE:
ReplyDelete10 9 8 7
6 5 4
3 2
1