Determining variable types for addition operation

Report a typo

You're working on a basic Kotlin program and need to fill in some missing types. You are given two variables, a and b, and you have already declared the type for the result variable as Double. The operation performed is addition. Determine the correct types for a and b that would allow this code to run successfully, while obeying Kotlin's type system and arithmetic operations.

Fill in the gaps with the relevant elements
fun main() {
    val a:  = 10
    val b:  = 20.5
    val result: Double = a + b
    println("The result of $a plus $b equals $result")
}
IntFloatStringDouble
___

Create a free account to access the full topic