Computer Science, asked by rajachakraborty2007, 16 hours ago

Print the output in java:
1525354555
1424344454
1323334353
1222324252
1121314151

Answers

Answered by PaulastyaChakraborty
2

Answer:

public class Test {

public static void main(String [] args) {

int i=5;

while (i!=0) {

 for(int j=1;j<6;j++) {

  System.out.print(j);   if(i!=j){

   System.out.print(i);

  }

  else {

   System.out.print(j);

    }}

i--;

System.out.print("\n");

}

}

}

Attachments:
Similar questions