whats the formula when it comes to exponent? for example: enter base number: 5 enter exponent number: 3 Power value: 125 | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

whats the formula when it comes to exponent? for example: enter base number: 5 enter exponent number: 3 Power value: 125

Exponent Formula

15th Jul 2017, 3:57 PM
Jecille Villanueva
Jecille Villanueva - avatar
1 Réponse
+ 1
//without cmath float a, //now it works for decimal point int b; cout << "Enter base"; cin >> a; cout << "enter power "; cin >> b; for(b;b>1;b--){ a=a*a; } cout << a <<endl;
15th Jul 2017, 7:09 PM
‎ ‏‏‎Anonymous Guy