Skip to content

Commit eb5a1d1

Browse files
committed
feat: Print numbers from 0 to 10 using a basic for loop
🧠 Logic: - Initialize loop variable `i` to 0. - Run the loop while `i <= 10`, incrementing `i` by 1 in each iteration. - Print the current value of `i` on each loop cycle. Signed-off-by: Somesh diwan <[email protected]>
1 parent c598c6c commit eb5a1d1

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Section8LoopAB/src/ForLoop.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
21
public class ForLoop {
3-
public static void main(String[] args)
4-
{
5-
for(int i=0; i<=10; i++)
6-
{
7-
System.out.println(i);
2+
public static void main(String[] args) {
3+
for(int i=0; i<=10; i++)
4+
{
5+
System.out.println(i);
6+
}
87
}
9-
}
10-
}
8+
}

0 commit comments

Comments
 (0)