Skip to content
Related Articles

Related Articles

GATE | GATE-CS-2002 | Question 18

View Discussion
Improve Article
Save Article
  • Last Updated : 28 Jun, 2021

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.

https://ide.geeksforgeeks.org/F6uLti.

See question 5 of https://www.geeksforgeeks.org/principle-of-programming-languages-set-1/

This solution is contributed by Anil Saikrishna Devarasetty

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!