Discussion :: Functions
-
What will be printed when this program is executed?
int f(int x)
{
if(x <= 4)
return x;
return f(--x);
}
void main()
{
printf("%d ", f(7));
}
Answer : Option C
Explanation :
In this recursive function call the function will return to main caller when the value of x is 4. Hence the output.
Be The First To Comment