- To print alphabets from A to Z
Output:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
fun main(args: Array<String>) {
var c:Char = 'A'
println("Alphabets from A to Z :")
for(i in 0..25)
print(c++ +" ");
}
Alphabets from A to Z : A B C D E F G H I J K L M N O P Q R S T U V W X Y ZProgram
Here, we just used 'for loop' for 26 alphabet characters
var c:Char = 'A' //set the 1st character
for(i in 0..25)
print(c++ +" ");
You can print the same in small alphabets, just set c='a'
Coming Soon !
QuickThe dreams I chased took me on a journey, a journey more rewarding than the goals