+ 2
multiplying the variables into powers
hi, tried to make one variable into power of one integer, ie., for example int a = 10 and i tried to get an answer int b = a^2, the answer i'm getting is 12. which is wrong right.. pls guide how to make use of power. Thanks - Martin
4 Réponses
+ 6
To calculate power of numbers in python, you don't need to import math. Just use:
print(pow(2,3))
The result will be 8 - > 2*2*2
+ 3
Martin Joshwa can you mention the programming language?
Because it make easy for the answerer to answer your question....
because this type of powering the number concept is different from one language to another...
+ 2
^ is bitwise xor operator..