C language alculate the nth power of a number in C

C language alculate the nth power of a number in C

long long num_power_n(int v, int n)
{
    long long x = 1;

    while (n != 0) {
        x *= v;
        --n;
    }

    return x;
}

Comments

Popular posts from this blog

Python Receiving and parse JSON Data via UDP protocol

ubus lua client method and event registration code demo/example