Kotlin program: Find out your Kotlin version
Write a Kotlin program to find out what version of Kotlin you are using.
Sample Solution:
Kotlin Code:
fun main() {
val kotlinVersion = KotlinVersion.CURRENT
println("Kotlin Version: ${kotlinVersion}")
}
Sample Output:
Kotlin Version: 1.8.21
Note:
When you run this program, it will output the version of Kotlin you are using, such as:
Kotlin Version: 1.5.30
The actual version number may vary depending on your Kotlin installation.
Kotlin Editor:
Previous: Print 'Hello' and name on separate lines.
Next: Display current date and time.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics