Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift Add Two Numbers

// function that adds two numbers
func addNumbers(num1: Int, num2: Int) -> Int {
  var sum = num1 + num2
  return sum
}

// calling function with two values
var result = addNumbers(num1: 3, num2: 4)

print("Sum: ", result)
 
PREVIOUS NEXT
Tagged: #Swift #Add #Two #Numbers
ADD COMMENT
Topic
Name
6+6 =