[Solved] C – Writing a function for an exponent without using Pow [closed]

[ad_1]

Try this:

long int x_to_the_n (int x,int n)
{
    int i; /* Variable used in loop counter */
    int number = 1;

    for (i = 0; i < n; ++i)
        number *= x;

    return(number);
}

[ad_2]

solved C – Writing a function for an exponent without using Pow [closed]