diff --git a/Section6/56.go b/Section6/56.go new file mode 100644 index 0000000..66b6d26 --- /dev/null +++ b/Section6/56.go @@ -0,0 +1,9 @@ +package main + +import "fmt" + +func main() { + for i := 0; i < 10; i++ { + fmt.Println(i) + } +} diff --git a/Section6/57.go b/Section6/57.go new file mode 100644 index 0000000..630294a --- /dev/null +++ b/Section6/57.go @@ -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) +}