Posts

Showing posts with the label uri 1164 solution uri online judge 1160 solution online judge problem uri online judge wiki uri problem solution uri 1165 solution python online judge uri prime number solution

pow() library functions in c++

Visit this for more details: www.russelltheprogrammer.com Collected from Sometimes  you  need to   use exponencial or  power  , there is a library functions  named   pow() . http://russelltheprogrammer.com/  ::  Source Some example in  c++  given below: 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; z = pow( x, y ); printf( “%.1f to the power of %.1f is %.1f\n”, x, y, z ); return 0; } Output: 7.0 to the powe...