Created
October 3, 2023 15:06
-
-
Save akwasiio/bba16dd7c02adcdcc2609b89825c6684 to your computer and use it in GitHub Desktop.
Code for RC's CracklePop question
This file contains hidden or 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 main() { | |
for (i in 1 .. 100) { | |
when { | |
i % 3 == 0 && i % 5 == 0 -> println("CracklePop") | |
i % 3 == 0 -> println("Crackle") | |
i % 5 == 0 -> println("Pop") | |
else -> println(i) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment