Consider the following C code: #include <stdio.h> int temp = 0; int fun(int x,…

PYQ UGC NET 2024

Consider the following C code:

#include <stdio.h>
int temp = 0;
int fun(int x, int y)
{
    int z; temp++;
    if (y==3) return(x*x*x);
    else { z=fun(x, y/3); return(z*z*z); }
}
int main()
{
    fun(4, 81);
    printf("%d", temp);
}

What will be the output of the above code?

  1. A.

    3

  2. B.

    4

  3. C.

    5

  4. D.

    6

Attempted by 166 students.

Sign up free to check your answer

Sign up free

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…