How to raise a number to an exponent in C | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 5

How to raise a number to an exponent in C

it seems x **y doesnt work in C, is there a way to do it?

24th Dec 2018, 2:50 PM
NyakoteyšŸ‡¬šŸ‡­šŸŽ¹
NyakoteyšŸ‡¬šŸ‡­šŸŽ¹ - avatar
6 Respostas
+ 10
Nyakotey try it this way --> pow(x,y). This means x raised to the power of y. Don't forget to #include <math.h> *Edited*
24th Dec 2018, 2:53 PM
Ikechukwu Okonkwo
Ikechukwu Okonkwo - avatar
+ 9
Nyakotey you're welcome...Happy coding..šŸ˜‰šŸ˜‰šŸ˜‰
24th Dec 2018, 3:29 PM
Ikechukwu Okonkwo
Ikechukwu Okonkwo - avatar
+ 7
*Asterisk* that is true...Thanks for the correction..
26th Dec 2018, 3:09 PM
Ikechukwu Okonkwo
Ikechukwu Okonkwo - avatar
+ 3
thank you
24th Dec 2018, 3:27 PM
NyakoteyšŸ‡¬šŸ‡­šŸŽ¹
NyakoteyšŸ‡¬šŸ‡­šŸŽ¹ - avatar
+ 3
šŸ’«iYkE4LIFEšŸ’« and Nyakotey it #include <math.h> he can use the pow(x,y); function.
26th Dec 2018, 11:18 AM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
25th Dec 2018, 10:14 AM
Anna
Anna - avatar