Skip to content

UGC NET CS 2014Theory of Computation and Compilers › Run Time SystemVerified

UGC NET CS 2014 PYQ: Consider the following statements $S1, S2$ and $S3$: $S1$: In call-by-value, anything that is passed into a…

Consider the following statements $S1, S2$ and $S3$:

$S1$: In call-by-value, anything that is passed into a function call is unchanged in the caller’s scope when the function returns.

$S2$: In call-by-reference, a function receives implicit reference to a variable used as argument.

$S3$: In call-by-reference, caller is unable to see the modified variable used as argument.

  1. A
    $S3$ and $S2$ are true.
  2. B
    $S3$ and $S1$ are true.
  3. C
    $S2$ and $S1$ are true.
    Correct answer
  4. D
    $S1, S2, S3$ are true.

Answer

(C) $S2$ and $S1$ are true.

Approach

Compare call-by-value and call-by-reference semantics.

Reviewed by UGC IQ Editorial Team.