Skip to content

Commit a7fc0d5

Browse files
committed
feat: Print numbers from 10 to 1 using reverse for loop
🧠 Logic: - Initialize loop variable `i` to 10. - Continue looping while `i > 0`, decrementing `i` in each iteration. - Print the current value of `i` to display numbers in descending order. Signed-off-by: Somesh diwan <[email protected]>
1 parent eb5a1d1 commit a7fc0d5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Section8LoopAB/src/ForLoopAB.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
public class ForLoopAB {
22
public static void main(String[] args) {
3-
for(int i=10; i>0; i--)
4-
{
3+
for(int i=10; i>0; i--) {
54
System.out.println(i);
65
}
76
}

0 commit comments

Comments
 (0)