BismiALLAH

This commit is contained in:
dadgam3er 2024-09-07 23:59:14 -04:00
parent abbf8a7794
commit e8528bbdf3

19
ReverseNestedLoop.java Normal file
View File

@ -0,0 +1,19 @@
public class ReverseNestedLoop {
public static void main(String[] args) {
// 1
// 2 3
// 4 5 6
// 7 8 9 10
// we need to create a nested loop that can print this pyramid.
int r = 1;
for (int i = 1; i <= 4; i++) {
System.out.println("");
for (int j = 1; j <= i; j++) {
System.out.print(r);
System.out.print("\t");
r++;
}
}
}
}