C Programming Code Examples C > Beginners Lab Assignments Code Examples program to find power of a number using pow function program to find power of a number using pow function Write a C program to input two numbers from user and find their power using pow() function. How to find power of a number in C programming. How to use pow() function in C programming. #include <stdio.h> #include <math.h> // Used for pow() function int main() { double base, expo, power; /* Input two numbers from user */ printf("Enter base: "); scanf("%lf", &base); printf("Enter exponent: "); scanf("%lf", &expo); /* Calculates base^expo */ power = pow(base, expo); printf("%.2lf ^ %.2lf = %.2lf", base, expo, power); return 0; }