Question 20 : Write a program in Java to print the following pattern :
5
44
333
2222
11111
Java Program :
public class pattern_7
{
public static void main()
{
int i,j;
for(i=5;i>=1;i--)
{
for(j=5;j>=i;j--)
{
System.out.print(i);
}
System.out.print("\n");
}
}
}
Good work
ReplyDeleteKeep it up and keep learning with others