Question 40Asked in UGC NET Computer Science, December 2014 (Paper II & III, Selected Questions)

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…

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. AS3 and S2 are true
  2. BS3 and S1 are true
  3. CS2 and S1 are true
  4. DS1, S2, S3 are true
Show answerHide answer

Correct answer: (C) S2 and S1 are true

Explanation

S1 is true: in call-by-value, anything passed into a function is unchanged in the caller's scope when the function returns. S2 is true: in call-by-reference the function receives an implicit reference to the argument variable. S3 is false, because in call-by-reference the caller always sees the modified value of the argument.

From UGC NET Computer Science PYQ, December 2014 (Paper II & III, Selected Questions)

This is question 40 of UGC NET Computer Science PYQ, December 2014 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.