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.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/kotlin-exercises/basic/kotlin-basic-exercise-1.php