Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun main(args: Array<String>){
- val burgersOrdered = 3
- when(burgersOrdered){
- 0 -> println("A")
- 1 -> println("B")
- 2, 3 -> println("C")
- else -> {
- println("It's smell well!!!")
- }
- }
- when(burgersOrdered){
- Math.abs(burgersOrdered) -> println("Ordered 0 or more burgers")
- else -> {
- println("Ordered less than 0")
- }
- }
- when(burgersOrdered){
- 0 -> println("A")
- in 1..4 -> println("B")
- in 5..9 -> println("C")
- else -> {
- println("Not sure")
- }
- }
- when {
- burgersOrdered <= 0 -> println("None ordered")
- burgersOrdered % 2 == 1 -> println("Odd number ordered")
- burgersOrdered % 2 == 0 -> println("Even number ordered")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement