+ 7

Hi friend, I need to know how to make power of an number in C++?

Is this valid code: power(2,5); //2^5

2nd Jun 2017, 12:25 AM
BENOTMANE
BENOTMANE - avatar
7 Answers
+ 3
using the (pow) function but you need to include <math.h> first example: #include <stdio.h> #include <math.h> int main () { printf ("12.34 ^ 56.78 = %f\n", pow (12.34, 56.78) ); return 0; }
2nd Jun 2017, 12:33 AM
Ahmed Omara
Ahmed Omara - avatar
+ 6
Thx @Ahmed you are right. Thx @Joshua but your code not valid in c++ maybe in Javascript or python.
2nd Jun 2017, 12:36 AM
BENOTMANE
BENOTMANE - avatar
+ 6
Hi friend . (surprise) .. My Code is now public please see it. Your names is include in it. https://code.sololearn.com/cjNOwm9Q0vt3/?ref=app
2nd Jun 2017, 5:13 PM
BENOTMANE
BENOTMANE - avatar
+ 2
2**5 in python
2nd Jun 2017, 12:42 AM
Ahmed Omara
Ahmed Omara - avatar
2nd Jun 2017, 12:43 AM
Vijaysai Suri
Vijaysai Suri - avatar
+ 2
just use ^ this, it will work for u
2nd Jun 2017, 6:38 PM
Swaraj Singh
Swaraj Singh - avatar
+ 1
2**5 i think........
2nd Jun 2017, 12:30 AM
Hiro
Hiro - avatar