I am currently learning C++. I was trying to compute power of an integer using the expression:
val=10^1;
Instead of expected answe
^ is the binary XOR operator in C++:
^
XOR
10 ^ 1 = 00001010 ^ 00000001 = -------- 00001011 = 11