Menu Close

Go – Program to print ASCII value of a character in go

Here, we will write a Program to print ASCII value of a character in go. ASCII aka American Standard Code for Information Interchange is used to represent characters into numeric value.

ASCII characters value lies between 0 to 127. Character represents in go as rune data type.


Characters     ASCII
----------      -----

A               65
0               48
a               97


package main

import (



func main() {

  c := 'A' // As a rune

  s := 'a'

  d := '0'

  fmt.Printf("ASCII value %d of character %c \n", c, c)

  fmt.Printf("ASCII value %d of character %c \n", s, s)

  fmt.Printf("ASCII value %d of character %c \n", d, d)


ASCII value 65 of character A

ASCII value 97 of character a

ASCII value 48 of character 0

To learn more about golang. Please follow given below link.


Posted in golang, golang program

Leave a Reply

Your email address will not be published. Required fields are marked *