Task

Pass a function     as an argument     to another function.



Related task

   First-class functions


func call(f, a, b) {
    f(a, b)
}
 
let a = 6
let b = 2
 
print("f=add, f(\(a), \(b)) = \(call((x, y) => x + y, a, b))")
print("f=mul, f(\(a), \(b)) = \(call((x, y) => x * y, a, b))")
print("f=div, f(\(a), \(b)) = \(call((x, y) => x / y, a, b))")