WAP in Java to give this number pattern:-
1 2 3 4 5
5 4 3 2
2 3 4
4 3
3
Answers
Answered by
0
ANSWER:
PLS MARK THE BRAINLIEST..................
public class Pattern {
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();
}
}
}
OUTPUT:
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
you can input your number instead of this
Similar questions
Hindi,
5 months ago
Math,
5 months ago
English,
11 months ago
Environmental Sciences,
11 months ago
Chemistry,
1 year ago