Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var myNumbers3 = [4, 11, 32, 5, 19]
- func addByTwo(_ input: inout [Int]) -> [Int] {
- for i in 0..<input.count {
- input[i] += 2
- }
- return input
- }
- print(addByTwo(&myNumbers3))
- print(myNumbers3)
- // => [6, 13, 34, 7, 21]
Add Comment
Please, Sign In to add comment