Kotlin Program to Find ASCII value of a character

bookmark

fun main(args: Array) {

    val c = 'a'
    val ascii = c.toInt()

    println("The ASCII value of $c is: $ascii")
}

 


Output:

The ASCII value of a is: 97