Section6.57
This commit is contained in:
9
Section6/56.go
Normal file
9
Section6/56.go
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
for i := 0; i < 10; i++ {
|
||||||
|
fmt.Println(i)
|
||||||
|
}
|
||||||
|
}
|
||||||
19
Section6/57.go
Normal file
19
Section6/57.go
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
// Replaces while loop in GO
|
||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
j := 10
|
||||||
|
for j >= 0 {
|
||||||
|
fmt.Println(j)
|
||||||
|
j--
|
||||||
|
}
|
||||||
|
|
||||||
|
// INFINITE LOOP
|
||||||
|
sum := 0
|
||||||
|
for {
|
||||||
|
sum++
|
||||||
|
}
|
||||||
|
fmt.Println(sum)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user