Multiple choice

In case of pass by reference

  1. the value of the variable is passed to the function so that it can manipulate it

  2. the location of variable in memory is passed to the function so that it can use the same memory area for its processing

  3. the value of the variable cannot be changed within the calling function

  4. the calling function cannot return the manipulated value

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Pass by reference means passing the memory address (location) of the variable to the function. This allows the function to directly access and modify the original variable in memory, rather than working with a copy. Changes made inside the called function affect the original variable in the calling function.