Skip to content

Instantly share code, notes, and snippets.

@yelinaung
Created June 10, 2014 05:27
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 yelinaung/ae19e4ec6f05c2aa54e5 to your computer and use it in GitHub Desktop.
Save yelinaung/ae19e4ec6f05c2aa54e5 to your computer and use it in GitHub Desktop.
Simple FizzBuzz in Swift
//
// main.swift
// SwiftTest
//
// Created by Ye Lin Aung on ၁၄/၀၆/၁၀.
// Copyright (c) ၂၀၁၄ Ye Lin Aung. All rights reserved.
//
import Foundation
var a = 1...100
for b in a {
if b % 15 == 0 {
println("fizzbuzz")
} else if b % 3 == 0 {
println("fizz")
} else if b % 5 == 0 {
println("buzz")
} else {
println(b)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment