# POW in C Programming

The C POW function is a C Math Library Function, used to calculate the Power of a specified value. For example, if x is base value and 2 is exponent then, pow (x, 2) = x². The syntax of the POW in C Programming is

`double pow(double base, double Exponent);`
• Base: Please specify the base value here.
• Exponent: Specify the Exponent value or power here.

## POW in C Example

The POW function used to return the Power of the given number. In this program, We are going to find the power of both positive and negative values, and display the output using the C Programming printf statement

```/* Example for POWER Function in C Programming */

#include <stdio.h>
#include <math.h>

int main()
{
int result1;
double result2, result3, result4, result5;

result1 = pow(5, 3);
printf("\n The Final result of %d Power %d = %d ", 5, 3, result1);

result2 = pow(2, 0);
printf("\n The Final result of %d Power %d = %f ", 2, 0, result2);

result3 = pow(0, 2);
printf("\n The Final result of %d Power %d = %f ", 0, 2, result3);

result4 = pow(-2, 3);
printf("\n The Final result of %d Power %d = %f ", -2, 3, result4);

result5 = pow(3, -4);
printf("\n The Final result of %d Power %d = %f ", 3, -4, result5);

return 0;
}```

### C POW Function Example 2

This program asks the user to enter his/her own base and exponent values. And then it will calculate the pow of user-specified values

```/* Example for POWER Function in C Programming */

#include <stdio.h>
#include <math.h>

int main()
{
int result, base, exponent;

printf("\n Please Enter the Base and Exponent Values : \n ");
scanf("%d %d", &base, &exponent);

result = pow(base, exponent);

printf("\n The Final result of %d Power %d = %d ", base, exponent, result);

return 0;
}```
`````` Please Enter the Base and Exponent Values :
2
5

The Final result of 2 Power 5 = 32``````