What function of x and n is computed by the below code segment?

int my prog (int x, int n) {

    int val = 1;

    if (n > 0) {

        if (n % 2 = = 1) val = val * x;

        val = val * my prog (x * x, n/2);

    }

    return val ;

}

1
x pow n
2
x* n
3
x * n/2
4
\(\sqrt[n]{x}\)

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation