How we take a exponent for any number?? | Sololearn: Learn to code for FREE!

0

How we take a exponent for any number??

c++

3/19/2017 5:06:16 PM

Karan Gupta

2 Answers

New Answer

+3

Do you mean raising a number to some n-th power? If so, you should use pow(a,b) –remember to include cmath library. #include <iostream> using namespace std; #include <cmath> using namespace std; int main() { cout<<pow(5,3)<<endl; return 0; }

+1

thanks