Kotlin When statements problem .😴 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

Kotlin When statements problem .😴

Why this code not running on code playground 🙄🙄 https://code.sololearn.com/ch3Lttd4sQEL/?ref=app

11th Sep 2021, 3:26 AM
Saurya
Saurya - avatar
2 Answers
+ 7
but it's working in other compiler 🙄
11th Sep 2021, 3:38 AM
Saurya
Saurya - avatar
+ 4
Why are you using Java Scanner instead of the Kotlin input. Remove all your current input lines and just replace with; var a = readLine()!!.toInt() P.S. the main issue with your use of Java Scanner has to do with the backticks around System`.in`. Your when statement itself is fine.
11th Sep 2021, 3:37 AM
ChaoticDawg
ChaoticDawg - avatar