Which operations are correct?

Report a typo

In the following code, select the lines that are correct:

fun Int.opp(f: Int.() -> Int): Int = f()

fun main() {
    10.opp { this.times(2) } // a
    10.opp { it.minus(2) } // b
    10.opp { toChar() } // c
    10.opp { plus(10) } // d
    10.opp { plus(10).div(10) } // e
    10.opp { this * 2 } // f
}
Select one or more options from the list
___

Create a free account to access the full topic