Kotlin Program to Check Whether an Alphabet is Vowel or Consonant

bookmark

fun main(args: Array<String>) {

    val ch = 'i'

    val vowelConsonant = if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') "vowel" else "consonant"

    println("$ch is $vowelConsonant")
}
 

 

Output:

i is vowel