#include<stdio.h>
#include<conio.h>
int f(int & ,int );//function prototype
main()
{
int x,p=5; //p is initialized to 5
x=f(p,p);
printf("\n Value is : %d",x);//print the value of x
getch();
}
int f (int & x, int c)
{
c=c-1;
if (c==0) return 1;
x=x+1;
return f(x,c) * x; //recursion
}
output : 6561
can anyone explain me the flow the program This question is from gate i couldn't understand it. It seems that the function is called with value of p = 5. It is catched in the function f by int &x the problem is here. Is the value i.e 5 is stored in x or in address of x.