Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. The results returned by function under value – result and reference parameter passing conventions
    1. do not differ
    2. differ in the presence of loops
    3. differ in all cases
    4. may differ in the presence of exception
Correct Option: D

In call by reference, the called function is working with the memory location of the passed variables. So, any update to the variables are immediately effective.
In call by value-result, the called function is working with a copy of the passed variable. On return, the updated values are copied back to the original variables. So during a function execution if an exception happens, in call by value-result, the passed variables won’t be getting update values.



Your comments will be displayed only after manual approval.