class NumberDemo{
public static void main(String[] args) {
int i, j, row=5;
for (i=1; i<=5 ;i++ ) {
for (j=1; j<=row ; j++ ) {
System.out.print(j +" ");
}
System.out.println();
row--;
}
}
}
Output:
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
class NumberDemo{
public static void main(String[] args) {
int i, j, row=5;
for (i=1; i<=5 ;i++ ) {
for (j=1; j<=row ; j++ ) {
System.out.print(j +" ");
}
System.out.println();
row--;
}
}
}
Output:
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
All Copyright © 2020 Are Reseved By Math Traders
No comments:
Post a Comment