Sedangkan loop di golang
n := 0
x := 42
for n != x {
n := guess()
}
Harendra
n := 0
x := 42
for n != x {
n := guess()
}
for condition {
// code block
}
for {
fmt.Println("Infinite Loop 1")
time.Sleep(time.Second)
}
// Program to print numbers between 1 and 5
package main
import ("fmt")
func main() {
number := 1
for number <= 5 {
fmt.Println(number)
number++
}
}