C- Bitwise Operators Questions and Answers
C- Bitwise Operators
Showing 10 of
24 questions
1. In which numbering system can the binary number 1011011111000101 be easily converted to?
- Decimal system
- Hexadecimal system
- Octal system
- No need to convert
2. Which bitwise operator is suitable for turning off a particular bit in a number?
- && operator
- & operator
- || operator
- ! operator
3. Which bitwise operator is suitable for turning on a particular bit in a number?
- && operator
- & operator
- || operator
- | operator
4. Which bitwise operator is suitable for checking whether a particular bit is on or off?
- && operator
- & operator
- || operator
- ! operator
5. What is the output of the following code?
int main() {
int a = 5, b = 3;
printf("%d", a & b);
return 0;
}
- 1
- 7
- 5
- 0
6. What does the bitwise XOR operator (^) do?
- Returns 1 if both bits are 1
- Returns 1 if both bits are different
- Returns 1 if both bits are same
- Returns 0 if both bits are different
10. What does the bitwise complement operator (~) do?
- Increments the value
- Flips all bits
- Decrements the value
- Doubles the value