Complete the code to declare a variable with type inference holding the number 10.
val number = [1]The number 10 is an integer, so just writing 10 lets Kotlin infer the type Int.
Complete the code to explicitly declare a variable of type Double with value 3.14.
val pi: [1] = 3.14
The value 3.14 is a decimal number, so the type should be Double.
Fix the error in the code by choosing the correct type for the variable holding true.
val isActive: [1] = trueThe value true is a boolean, so the variable type must be Boolean.
Fill both blanks to declare a mutable variable of type String with value "Hello".
var greeting: [1] = [2]
The variable greeting should be a String and assigned the text "Hello".
Fill all three blanks to create a read-only variable with type inferred as Int and value 42.
val [1] = [2] // inferred type is [3]
The variable name is answer, assigned the number 42, which Kotlin infers as type Int.