w3resource

Kotlin program: Print 'Hello' and name on separate lines

Kotlin Basic: Exercise-1 with Solution

Write a Kotlin program to print 'Hello' on screen and your name on a separate line.

Sample Solution:

Kotlin Code:

fun main() {
    println("Hello\nRenata Evangelina")
}

Sample Output:

Hello
Renata Evangelina

Kotlin Editor:


Previous: Kotlin Basic Exercises Home.
Next: Find out your Kotlin version.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.