C-Programming |Gate-2009| previous year questions| Set-11

Set-15 C-Programming Gate 2005

C-Programming |Gate-2009|

  1. Consider the program below:
    # include < stdio .h >
    int fun(int n, int * f_p)
    {
    int t, f;
    if (n <= 1)
    { * f_p = 1;
    return 1;
    }
    t = fun (n- 1, f_p);
    f = t+ * f_p;
    * f_p = t;
    return f;
    }
    int main()
    {
    int x = 15;
    printf (” % d\ n”, fun(5, & x));
    return 0;
    }
    The value printed is : [GATE – 2009]

a. 6
b. 8
c. 14
d. 15

Answer : b)


Back to GATE-HOME


Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *