package main

import "fmt"

func main() {
    i := 10

    // omitting the initialization and update
    // statements, but keeping the condition
    // check.
    for ; i != 0 ; {
        fmt.Println(i)
        i--
    }

    // these semicolons look ugly, don't they?
    // if you remove them, 'for' becomes 'while'
    j := 10

    for j != 0 {
        fmt.Println(j)
        j--
    }

    // omit all of them, then it's a infinite
    // loop.
    // for {
    // }
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: