Created
October 12, 2017 03:05
-
-
Save melcu/60ae201522b4fd9937ff8305178a65ea to your computer and use it in GitHub Desktop.
Fizz Buzz Algorithm Swift 4
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
| var oneK = [Int]() | |
| for i in 1...100{oneK.append(i)} | |
| for num in oneK { | |
| if num % 15 == 0 { print("\(num) FizzBuzzz") } | |
| else if num % 3 == 0 { print("\(num) Fizz") } | |
| else if num % 5 == 0 { print("\(num) BuzZZZzzz") } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment