Skip to content

Instantly share code, notes, and snippets.

@jaredrummler
Created February 24, 2017 12:43
Show Gist options
  • Select an option

  • Save jaredrummler/d2b8ed557cb38636ea473818de35d6f6 to your computer and use it in GitHub Desktop.

Select an option

Save jaredrummler/d2b8ed557cb38636ea473818de35d6f6 to your computer and use it in GitHub Desktop.
Kotlin FizzBuzz
fun main(args: Array<String>) {
for (i in 1..100) {
println(if (i % 15 == 0) "FizzBuzz" else if (i % 3 == 0) "Fizz" else if (i % 5 == 0) "Buzz" else i)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment