// Java Program to Print the Pattern Using Nested Loops
/*
1
21
321
4321
54321
*/
public class NumberPattern {
public static void main(String[] args) {
int rows = 5;
for (int i = 1; i <= rows; i++) {
// Print leading spaces
for (int s = rows - i; s > 0; s--) {
[Link](" ");
}
// Print decreasing numbers
for (int num = i; num >= 1; num--) {
[Link](num);
}
[Link]();
}
}
}