Skip to content

Instantly share code, notes, and snippets.

@mildocjr
Created August 10, 2018 03:10
Show Gist options
  • Select an option

  • Save mildocjr/fd987afb8c390c5cd0c88447d2f3b94c to your computer and use it in GitHub Desktop.

Select an option

Save mildocjr/fd987afb8c390c5cd0c88447d2f3b94c to your computer and use it in GitHub Desktop.
functions-1
// Define the function
func addTwoNumbers(number firstNumber: Int,otherNumber secondNumber: Int) -> Int {
let functionResult = firstNumber + secondNumber
return functionResult
}
// Call the function
var result = addTwoNumbers(number: 5, otherNumber: 3)
// result is equal to 8
result = addTwoNumbers(number: 10, otherNumber: result)
// result is now equal to 18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment