Gate CS-2015-2 Question Paper With Solutions

Q. 33 Consider the following C function.

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;  } 

The return value of fun (5) is ______

(A) 0

(B) 26

(C) 51

(D) 71

Answer: (C)

Explanation:

Gate CS-2015-2 Question Paper With Solutions

Learn More:   Gate CS-2013 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here