Skip to content

Instantly share code, notes, and snippets.

@carlosdiaz
Created September 30, 2015 22:37
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 carlosdiaz/4355b8fb0db012b2c4d5 to your computer and use it in GitHub Desktop.
Save carlosdiaz/4355b8fb0db012b2c4d5 to your computer and use it in GitHub Desktop.
FizzBuzz in scala
//FizzBuzz in scala
object FizzBuzz{
def main(args: Array[String]){
for (i <- 0 until 100){
if (i % 3 == 0){
if(i % 5 == 0){
println(i + " is FizzBuzz")
}
else
{
println(i + " is Fizz")
}
}
else if(i % 5 == 0)
{
println(i + " is Buzz")
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment