1
1_2
1_2_3
1_2_3_4
1_2_3_4_5
_ stands for space
class A
{
int i,j;
public void show()
{
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(j+" ");
}
System.out.println();
}
}
public static void main(String args[])
{
A ob=new A();
ob.show();
}
}
Related Post: BlueJ Programs On Pattern
No comments:
Post a Comment