Top 20 MCQs on AND, OR, XOR, NOT, left/right shifts. Very common in C/C++/Java aptitude tests!
What is the result of 5 & 3?
What is the result of 5 | 3?
What is the result of 5 ^ 3?
What is ~5 in a 32-bit integer?
What is 6 << 1?
What is 16 >> 2?
Which operation can be used to check if a number is odd?
What is 7 ^ 7?
What is 0 ^ n equal to?
Which is used to set the k-th bit of n?
How do you clear the k-th bit of n?
What is the result of 12 & 10?
What is 255 ^ 255?
What is the value of (5 >> 1)?
Which expression swaps two variables a and b without a temp variable?
What is the output of: int x = 10; x = x & (x-1); printf("%d", x);
How many set bits does 13 have?
What is 1 << 0?
If n = 8 (binary 1000), what is n & (n-1)?
What is the result of (a | b) if a = 6 (110) and b = 5 (101)?
Other Technical Topics: