Using BlueJ print the pattern
12345678910
13579
14710
159
16
17
18
19
110
1
class BlueJx
{
public void show()
{
int j,x=1,y=0;
for(int i=0;i< 10;i++)
{
x=1;
while(x< =10)
{
System.out.print(x);
x=x+y+1;
}
y=y+1;
System.out.println();
}
}
public static void main(String args[])
{
BlueJx ob=new BlueJx();
ob.show();
}
}
No comments:
Post a Comment