Skip to content

Instantly share code, notes, and snippets.

@nbness2
Created November 27, 2021 10:55
Show Gist options
  • Save nbness2/2de3d7aa35335f5723e5b56cc1eb56a2 to your computer and use it in GitHub Desktop.
Save nbness2/2de3d7aa35335f5723e5b56cc1eb56a2 to your computer and use it in GitHub Desktop.
val random = Random
val randomNumber = random.nextInt()
val sign = if (randomNumber > 0) {
"positive"
} else if (randomNumber < 0) {
"negative"
} else {
"zero"
}
println("Number is $sign")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment