Kotlin Program to Display Characters from A to Z using a loop

Kotlin Program to Display Characters from A to Z using a loop: In this program, you’ll learn to print English alphabets using while loop in Kotlin. You’ll also learn to print only uppercased and lowercased alphabets.

Kotlin Program to Display Characters from A to Z using a loop

Source Code

fun main(args: Array<String>) {
    var c: Char

    c = 'A'
    while (c <= 'Z') {
        print("$c ")
        ++c
    }
}

Output