In a similar fashion, there is one more program, called sorting numbers
Write the code for the following output:
11 2 1 2 31 2 3 4
The code for the preceding output will be:
for(int i=1;i<5;i++) // (outer for loop) it will loop for 4 times { for(int j=1;j<=i;j++) //(inner for loop) { System.out.print("j"); System.out.print("\t"); } System.out.println(" "); }