Skip to content

Instantly share code, notes, and snippets.

@saoudrizwan
Last active February 11, 2017 02:08
Show Gist options
  • Save saoudrizwan/5a3bbd4d634659d9e8336bf4f1501114 to your computer and use it in GitHub Desktop.
Save saoudrizwan/5a3bbd4d634659d9e8336bf4f1501114 to your computer and use it in GitHub Desktop.
let numbers = [1, 2, 3, 4, 5]
var evenNumbers = [Int]()
for i in 0..<numbers.count {
let number = numbers[i]
if number % 2 == 0 {
evenNumbers.append(number)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment