Created
August 10, 2018 03:10
-
-
Save mildocjr/fd987afb8c390c5cd0c88447d2f3b94c to your computer and use it in GitHub Desktop.
functions-1
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
| // 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