Go 语言打印所有字符的 ASCII 值程序

编写一个 Go 程序来打印所有可用字符的 ASCII 值。为此,我们使用一个从零开始到 255 结束的 for 循环。在循环中,我们使用 printf 语句打印字符及其相应的 ASCII 码。

package main

import (
    "fmt"
)

func main() {

    for i := 0; i <= 255; i++ {
        fmt.Printf("The ASCII value of %c = %d\n", i, i)
    }
}
Go program to Print ASCII Values of All Characters