C Program to Find Nth Power Using Function

In this program, you'll learn to find nth power of a number using function.

Source Code

void power(int, int);

int main()
    int x, y;
    printf("\nEnter number: ");
    scanf("%d", &x);
    printf("Enter power: ");
    scanf("%d", &y);
    power(x, y);
    return 0;

void power(int x, int y)
    int p;
    p = pow(x, y);
    printf("\nPower of number x raise to y (x^y) = %d", p);
Enter number: 5
Enter power: 4

Power of number x raise to y (x^y) = 624

"Coding Hub - Learn to code" app now available on Google Play Store