Question Detail

COS 102 test topic Objective Question

Question

What does the term 'pass-by-value' imply regarding function parameter passing?
Options
A The parameter receives a direct reference to the caller's variable
B A copy of the actual argument's value is passed to the parameter
Correct Answer
C The variable can only hold numeric values
D Modifications inside the function automatically alter the caller's variable
Correct Answer

Option B is the correct answer.

Detailed Explanation

Pass-by-value creates a localized copy of the argument; mutations to the formal parameter leave the original argument intact.

Hint

No hint available

Question Info