I am trying to print the following pattern but don't get the logic how to.. Can you please help me out.. I am using BlueJ and this is my first question so I am not sure what is required.
1
2 2
3 3 3 3
4 4 4 4 4 4
Thank You in advance.
i have tried this
public class Program92
{
public static void main()
{
for(int x=1;x<=5;x++)
{
for(int j=1;j<=x;j++)
System.out.print(x);
System.out.println();
}
}
}
but could only get
1
22
333
4444
55555