0
What error in this code mathematicaly answer 3 but in this code answer is 0
2 Answers
+ 5
What do you mean ?
It's mathematically correct.
Xor operator (^) is commutative ( a^b will be equal to b^a) and thus
((x^y)>(y^x)) will always evaluate to be false, and even your compiler is telling you the same.
+ 4
The ^ character is the bitwise exclusive OR operator (XOR for short), which is commutative, hence the warning that a self-comparison like that always fails.
https://www.sololearn.com/learn/4074/?ref=app
I assume you want to compute the power instead. In that case, have a look at pow() from the standard library:
https://en.cppreference.com/w/c/numeric/math/pow