1 parent 9779d80 commit 71eb2cbCopy full SHA for 71eb2cb
1 file changed
ch07/MyLoopsC.java
@@ -0,0 +1,38 @@
1
+public class MyLoopsC
2
+{
3
+ public static void main(String[] args)
4
+ {
5
+ exercise7cForLoop();
6
+
7
+ exercise7cWhile();
8
9
+ exercise7cDoWhile();
10
+ }
11
12
+ private static void exercise7cForLoop()
13
14
+ for (int x = 100; x >= -100; x -= 8)
15
16
+ System.out.println(x);
17
18
19
20
+ private static void exercise7cWhile()
21
22
+ int x = 100;
23
+ while (x >= -100)
24
25
26
+ x -= 8;
27
28
29
30
+ private static void exercise7cDoWhile()
31
32
33
+ do{
34
35
36
+ } while (x >= -100);
37
38
+}
0 commit comments