0
Why do we get zero for the below equation as we know, 1^1=1 ?
int x = 1; x^=1; cout << x; output ------------- 0
1 Antwort
+ 3
The "^" is not "to the power of" in most programming languages.
https://stackoverflow.com/questions/14526584/what-does-the-xor-operator-do
Try:
C++:
pow(1,1);
or
JS:
Math.pow(1,1);