Q. | What is the following function computing? Assume a and b are positive integers. int fn( int a, int b) {
if (b == 0)
return b;
else
return (a * fn(a, b - 1));
}
|
|||||||
|
Answer: | Option A | |
Explaination: | The output is always be 0 because b is decremented in recursive function fn each time by 1 till the terminating condition b==0 where it will return 0. |
Discussion
Your Comments Goes here... |
Name | Discussion |
---|