Section6.57
This commit is contained in:
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