Skip to content

Instantly share code, notes, and snippets.

@simplyluke
Created July 17, 2015 02:56
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 simplyluke/5d34fbd5e922e04b6847 to your computer and use it in GitHub Desktop.
Save simplyluke/5d34fbd5e922e04b6847 to your computer and use it in GitHub Desktop.
func fizzBuzz(n: Int) -> String {
if n % 3 == 0 && n % 5 == 0 {
return "FizzBuzz"
} else if n % 5 == 0 {
return "Buzz"
} else if n % 3 == 0 {
return "Fizz"
} else {
return String(n)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment