Challenge 3: Smart Casts — Solution fun describeAge(age: Int?) { if (age != null) { // Smart-cast: age is treated as Int (not Int?) inside this block if (age % 2 == 0) { println("Age $age is even") } else { println("Age $age is odd") } } else { println("Age unknown") } } fun main() { describeAge(33) describeAge(40) describeAge(null) } /* Output: Age 33 is odd Age 40 is even Age unknown Notes: - Inside the "if (age != null)" branch, Kotlin smart-casts age from Int? to Int automatically — age % 2 works directly, with no ?. or !! needed. - The smart cast only applies because age is a val parameter that can't change between the check and the use; Kotlin wouldn't smart-cast a mutable var property that another thread could modify in between. - The else branch handles the null case explicitly, so every possible input is covered without ever forcing a value with !!. */