Home >>C Math Functions >C math pow() function

C math pow() function

C math pow() function

The C math pow() function is used to return the given input argument x raised to the given power of y. It takes two arguments (base value and power value) and returns the power raised to the base number. This function is defined in math.h header file.

Syntax:
double pow(double x, double y)

Parameter Values

Parameter Description
x It is the floating point base value.
y It is the floating point power value.
Here is an example of pow() function:

#include <stdio.h>
#include <math.h>
int main () 
{
printf("Value 8.0 ^ 3 = %lf\n", pow(8.0, 3));
return(0);
}

Output:
Value 8.0 ^ 3 = 512.000000
Example-2

#include <stdio.h>
#include <math.h>
int main ()
{
printf("Value 8.0 ^ 3 = %lf\n", pow(9.6, 5));
return(0);
}

Output:
Value 9.6 ^ 5 = 81537.269760

No Sidebar ads