Hello.
I'm having a difficult time understanding bitwise operators, specifically & (and) and | (or). How does one actually code it? This is how I've been coding them until now, but when I work it out by hand, I get a different answer than the one the executable is giving me. Furthermore, I checked a bitwise operator calculator online which also gives me the same answer I get by hand. For example, I'm taking two variables and declaring them: A = 5 and B = 8.
It gives me the wrong answer when I run it. I'm assuming I'm coding it wrong. Can someone help me?Code:printf("The bitwise operation & result for A and B is: ", A & B);
Thanks!