GATE | GATE-CS-2002 | Question 18

The results returned by functions under value-result and reference parameter passing conventions
(A) Do not differ
(B) Differ in the presence of loops
(C) Differ in all cases
(D) May differ in the presence of exceptions

Answer: (D)

Explanation: The result is updated since the updated values are returned back to the original variable. In call by reference, any change in the variable reflects immediately.

A small example for call by reference and call by value is given below.

See question 5 of

This solution is contributed by Anil Saikrishna Devarasetty

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.