Skip to content

Commit 4dee4c7

Browse files
For Loop
1 parent 68bb420 commit 4dee4c7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

23.For_Loops/cwh_23_for_loop.java

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
public class cwh_23_for_loop {
2+
public static void main(String[] args) {
3+
// for (int i=1; i<=10; i++){
4+
// System.out.println(i);
5+
// }
6+
// 2i = Even Numbers = 0, 2, 4, 6, 8
7+
// 2i+1 = Odd Numbers = 1, 3, 5, 7, 9
8+
//int n = 3;
9+
//for (int i =0; i<n; i++){
10+
// System.out.println(2*i+1);
11+
//}
12+
13+
for(int i=5; i!=0; i--){
14+
System.out.println(i);
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)