0
I want to do a bitwise & operator in my program. I don't know why return 0. I do bit and bit.
& operator. https://code.sololearn.com/cW0KgH08e4hG/?ref=app
2 odpowiedzi
+ 3
Do you know about how bitwise & works? The result is correct. What result you were expecting?
Bitwise operators check bits of both operands one by one. If both the bits are 1 , corresponding bit in result is set to 1 otherwise 0.
1 -> 01
2 -> 10
1&2 -> 00
+ 2
Neba Emmanuel , && isn't bitwise operator. It's a logical operator.
&& - Logical.
& - Bitwise.