Bitwise Operators | SoloLearn: Learn to code for FREE!

0

Bitwise Operators

I know there are operators like & and | those work with binary numbers (convert from decimal to binary) But... Are there more operators? And... Is it easy to know the result without make the number binary? Pd: I saw the operator ^ in a challenge and I'm not sure what it's (I lost :p)

7/8/2017 10:57:27 AM

Andrés04_ve

5 Answers

New Answer

+10

^ is xor operator. It gives 1 if the operands are different, and gives 0 if they are same. 0^0 = 0 0^1 = 1 1^0 = 1 1^1 = 0

+6

more about bitwise operators in C/C++ (and in many other languages too) https://en.m.wikipedia.org/wiki/Bitwise_operations_in_C

+2

+2

Okay, thanks a lot!

+1

If the numbers are 6^10, it works like that: 0110 (6) 1010 (10) _________ 1100 (14) ?