Question: Design a java program to print the following pattern.
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
Answers
Answered by
1
Answer:
public class Main {
public static void main(String[] args) { int rows = 5;
for (int i = rows; i >= 1; --i) {
for (int j = 1; j <= i; ++j) {
System.out.print(j + " ");
}
System.out.println();
}
}
}
Similar questions
CBSE BOARD XII,
1 month ago
Math,
1 month ago
Hindi,
1 month ago
Political Science,
2 months ago
Math,
9 months ago
English,
9 months ago
Science,
9 months ago