Kotlin - Data Types
What will be printed by the following Kotlin code?
val num: Double = 7.85 val intNum: Int = num.toInt() println(intNum)
val num: Double = 7.85 val intNum: Int = num.toInt() println(intNum)
toInt() function truncates the decimal part, not rounding.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions