Created
March 3, 2019 11:25
-
-
Save MarcinMoskala/2c2a470e9aef9975bd3b38fccfc6d1f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun describeNormalNum(num: Int) { | |
val description = when { | |
num % 2 == 0 -> "Is even" | |
num % 2 == 1 -> "Is odd" | |
else -> throw Error() | |
} | |
print(description) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment