Gate CS-2015-3 Question Paper With Solutions

Q. 47 Consider the following recursive C function.

void get (int n)  {     if (n < 1) return;     get(n-1);     get(n-3);     printf("%d", n);  } 

If get (6) function is being called in main () then how many times will the get ()
function be invoked before returning to the main ()?

(A) 15

(B) 25

(C) 35

(D) 45

Answer: (B)

Explanation:

Gate CS-2015-3 Question Paper With Solutions Gate CS-2015-3 Question Paper With Solutions

Learn More:   Gate CS-2009 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here