This question belongs to Swift Programming Language , specifically the domain on functions , including internal and external parameter names and default parameter values .
The function is defined as:
func rightSum(_ num1: Int, by num2: Int, and num3: Int = 25) - > Int {
return num1 + num2 + num3
}
This means:
the first parameter uses _, so it has no external label
the second parameter must use the external label by
the third parameter must use the external label and
the third parameter also has a default value of 25, so it may be omitted
Now evaluate each option:
A is invalid because it uses num2: instead of the required external label by:
B is valid because it correctly uses no label for the first argument, then by: and and:
C is invalid because the first parameter cannot be called with num1: since the external label is omitted with _
D is valid because it correctly passes the first argument unlabeled and the second with by:, while omitting the third argument so Swift uses the default value 25
E is invalid because it uses num1: and num2: instead of the required calling syntax
So the two correct function calls are B and D .