0
1.7kviews
Explain difference between call by value and call by reference.

Mumbai university > FE > SEM 2 > Structured Programming Approach

Marks: 4M

Year: May 2013

1 Answer
0
16views
Sr. No. Call by Value Call by Reference
1. In this the function is invoked by a calling function, by passing the actual values to be processed. In this the function is invoked by a calling function, by passing the addresses of the actual values to be processed.
2. Value of an argument is copied into the formal parameters of functions. Address of an argument is copied in the parameter.
3. Duplicate Copy of Original Parameter is Passed. Actual Copy of Original Parameter is Passed.
4. No effect on Original Parameter after modifying parameter in function. Original Parameter gets affected if value of parameter changed inside function.
5. enter image description here enter image description here
6. Output:Number 1: 50 Number 2: 70 Output:Number 1: 70 Number 2: 50
Please log in to add an answer.