What will be the output of the following code?
int fun(int n)

    static int v = 0;
    if (n >= 5) return 1;
    v=n;
    return fun(n+1) + v;
}

int main() {
    printf("output is %d", fun(1));
    return 0;
}

1
6
2
12
3
11
4
17

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation