Join Slack
Powered by
Screenshot_20240628_094234_Kotlin Compiler Offline...
# getting-started
s
Sebastian
06/28/2024, 4:45 PM
Screenshot_20240628_094234_Kotlin Compiler Offline.jpg
e
eax
06/28/2024, 5:25 PM
.toInt()
m
mohamed ehab
06/28/2024, 6:35 PM
readLine() accepts the numbers as a String so you need to cast it into an Int, you could also use (!!) to prevent null entries. var num = readLine()!!.toInt()
s
Sebastian
06/28/2024, 6:38 PM
Yeh thanks, it seems readln().toInt() is the preferred way
4
Views
Open in Slack
Previous
Next