Computer Sciences > Gate 2015 Set-2 > Recursion
Consider the following C function.
The return value of fun(5) is __________.
int fun (int n)
{
int x=1, k;
if (n==1) return x;
for (k=1; k < n; ++k)
x = x + fun(k) * fun(n β k);
return x;
}
{
int x=1, k;
if (n==1) return x;
for (k=1; k < n; ++k)
x = x + fun(k) * fun(n β k);
return x;
}
The return value of fun(5) is __________.
Correct : a
Similar Questions
Consider the following program written in pseudo-code. Assume that x and y are integers.
Count (x, y) {
if (y !=1 ) {
&n...
Consider the following program written in pseudo-code. Assume that x and y are integers.
Count (x, y) {
if (y !=1 ) {
&n...
Consider the following program written in pseudo-code. Assume that x and y are integers.
Count (x, y) {
if (y !=1 ) {
&n...
Total Unique Visitors
Loading......