We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df7efe4 commit 1831b8eCopy full SHA for 1831b8e
codes/ch4_looping/for.go
@@ -0,0 +1,16 @@
1
+package main
2
+
3
+import "fmt";
4
5
+func main() {
6
7
+ /**
8
+ * `for` loop
9
+ *
10
+ * for [assignment]; [conditions]; [increment/decrement] { ... }
11
+ */
12
+ for i := 0; i < 10; i++ {
13
+ fmt.Println("i =", i)
14
+ }
15
16
+}
codes/ch4_looping/while.go
@@ -0,0 +1,18 @@
+ * There is no while loop in Go-lang;
+ * but we can use `for` loop to behave like `while` loop.
+ i := 0;
+ for i < 10 {
+ i++
17
18
0 commit comments