Creating a dynamic greeting message

Report a typo

Suppose you have a Kotlin program where you need to create a greeting message by combining two pieces of information: a static message that says 'Hello' and a variable containing a name. Fill in the blanks in the following code to declare these two variables and create the complete greeting message.

Fill in the gaps with the relevant elements
 greeting:  = "Hello"
val name: String = "Kotlin"
val wholeGreeting = "$greeting, $name!"
(wholeGreeting)
___

Create a free account to access the full topic