if x=5
y=7
then how come AND bitwise operator of x & y is 5 ??
then how come OR bitwise operator of x | y is 7 ??
then how come XOR bitwise operator of x ^y is 2 ??
Bitwise operator function
@shambhavi_2420
first you need to convert these numbers into their binary form
5 = 101
7 = 111
101
111 &
---
101 = 5
---
101
111 |
---
111 = 7
---
101
111 ^
---
010 = 2
---
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.