Created
November 17, 2019 21:35
-
-
Save magdamiu/76bd2f3c30ec9d0eb59758113893b166 to your computer and use it in GitHub Desktop.
if/else
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
val number = 0 | |
val result = if (number > 0) { | |
"Positive number" | |
} else if (number < 0) { | |
"Negative number" | |
} else { | |
"Zero" | |
} | |
println(result) // => Zero |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment