ICSE Class 10 Computer Applications Question 13 of 43

User-Defined Methods — Question 13

Back to all questions
13
Question

Question 11

When an argument is passed by reference,

  1. a variable is created in the function to hold the argument's value.
  2. the function cannot access the argument's value.
  3. a temporary variable is created in the calling program to hold the argument's value.
  4. the function accesses the argument's original value in the calling program.
Answer

the function accesses the argument's original value in the calling program.

Reason — In call by reference, the called method does not create its own copy of original values, rather, it refers to the original values through the references. Thus, the called method works with the original data and any change in the values gets reflected to the data.