double pow( double x, int y ); // C++ only
float pow( float x, float y ); // C++ only
float pow( float x, int y ); // C++ only
long double pow( long double x, long double y ); // C++ only
long double pow( long double x, int y ); // C++ only
Even you can also use pow() function as below method:
double pow( double x, double y );
float powf( float x, float y );
long double powl( long double x, long double y );
Let’s See Some Code in C++:
#include <bits/stdc++.h>
using namespace std;
int main()
{
double x = 7.0, y = 9.0, z;
{
double x = 7.0, y = 9.0, z;
z = pow( x, y );
printf( “%.1f to the power of %.1f is %.1f\n”, x, y, z );
printf( “%.1f to the power of %.1f is %.1f\n”, x, y, z );
return 0;
}
}
Output:
7.0 to the power of 9.0 is 40353607.0
Comments
Post a Comment
Thanks for your message