Bitwise Operators Interview Questions

 Bitwise Operators Interview Questions
1.In which numbering system can the binary number 1011011111000101 be easily converted to?
a)Decimal system
b)Hexadecimal system
c)Octal system
 d)No need to convert
Answer: Option B
Explanation:
Hexadecimal system is better, because each 4-digit binary represents one Hexadecimal digit.
2.Which bitwise operator is suitable for turning off a particular bit in a number?
 a)&& operator
b)& operator
c)|| operator
d)! operator
Answer: Option B
3.Which bitwise operator is suitable for turning on a particular bit in a number?
a)&& operator
b)& operator
c)|| operator
d)! operator

 Answer: Option D
4.Which bitwise operator is suitable for checking whether a particular bit is on or off?
a)&& operator
b)& operator
c)|| operator
d)! operator
Answer: Option B
5.Left shifting a number by 1 is always equivalent to multiplying it by 2?
a)True
b)False
Answer: Option A
Explanation:
0001 => 1
0010 => 2
0100 => 4
1000 => 8

No comments: