fun main(args:Array<String>) { println("ENTER A NO BETWEEN 1 - 10") var enterno= readLine()!!.toInt() when(enterno) { 1-> println("WRONG NO 1") 2-> println("GET CLOSE 2") 3-> println("CLOSER 3" ) 4-> println("HMM 4 ") 5-> println("GOOD 5") else->{ println("sorry you lost") } } }
- OUTPUT
- ENTER A NO BETWEEN 1 - 10
- 2
- GET CLOSE 2
- Process finished with exit code 0
0 comments:
Post a Comment