Consider 2 cases:
1. Call by value result
2. Call by reference
int x = 10 ;
main ( )
{
P(x); printf (x);
}
P ( int a)
{
If ( a ≤ 40 )
{
a = a +10;
P(a);
x=a+10;
}
}
Please explain this in the above referenceIn case of call by reference the value of the actual parameter is simultaneously updated whereas, in case of call by value result, the final value of a formal parameter is passed to actual.
Any example in which these 2 will differ in output(especially in case of function calls)?