Kotlin - Control Flow as Expressions
What is the output of the following Kotlin code?
val x = 5 val result = if (x % 2 == 0) "Even" else "Odd" println(result)
val x = 5 val result = if (x % 2 == 0) "Even" else "Odd" println(result)
x % 2 == 0else branch returns "Odd".15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions