Methods with return value in Swift
Forums:
func getSum(n1: Int, _ n2: Int) -> Int {
return n1 + n2
}
let sum = getSum(5, 3)
//sum is 8
- Log in to post comments
func getSum(n1: Int, _ n2: Int) -> Int {
return n1 + n2
}
let sum = getSum(5, 3)
//sum is 8