Consider following program
int A(int &a,int b)
{
b=b-1;
if(b==0) return 1;
a=a+1;
return a+A(a,b);
}
Note that first parameter is passed by reference and second by value. What is the return value by A(x,x) where the value of x is 5.
Confusion is that in C there is no order of evaluation of operands of a operator. So here, will the a value is calculated first or is the function called...As per the ans they have used the modified value of a...is there a logic for this resolution of operands...??