The following C program shows how to Find power of a number using for loop.

/******************************************************************************

            Program to Find power of a number using for loop

*******************************************************************************/

#include <stdio.h>

int main()
{
    int p, q, i, power=1;
    printf("Enter a number: ");
    scanf("%d", &p);
    printf("Enter the value of exponent: ");
    scanf("%d", &q);
    for(i=1;i<=q;i++){
        power*=p;
    }
    printf("%d raise to the power %d is %d", p, q, power);
    return 0;
}

Output

The Output of the Program to Find power of a number using for loop.
The Output of the Program to Find power of a number using for loop.

Further Reading

50+ C Programming Interview Questions and Answers

C Program to Find Factorial of a Number