how to print this paater by using nested for loop
1
20
300
4000
50000
Answers
Answered by
0
for (int i = 1; i <= 6; i++) {
for (int j = 6 - i; j >= 1; j--)
System.out.print(" ");
for (int j = i; j >= 1; j--)
System.out.print(j + " ");
System.out.println();
}
System.out.println();
this is the logic
for (int j = 6 - i; j >= 1; j--)
System.out.print(" ");
for (int j = i; j >= 1; j--)
System.out.print(j + " ");
System.out.println();
}
System.out.println();
this is the logic
Similar questions