Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@astail
Created November 6, 2015 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astail/bef3c0854350da30602b to your computer and use it in GitHub Desktop.
Save astail/bef3c0854350da30602b to your computer and use it in GitHub Desktop.
[astel@MacBook-Pro ] $ cat FizzBuzz.scala
val x=10
if (x%3 == 0 && x%5 == 0) {
println("FizzBuzz")
} else if (x%3 == 0) {
println("Fizz")
} else if (x%5 == 0) {
println("Buzz")
} else {
println(x)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment