loop1.goΒΆ

// loop1.go

// To run at the command line:
//    $ go run loop1.go

package main

import "fmt"

func main() {
    for i := 0; i < 10; i++ {
        if i%2 == 0 {
            fmt.Printf("%v is even\n", i)
        } else {
            fmt.Printf("%v is odd\n", i)
        }
    }
}