C- Bitwise Operators Questions and Answers
Bitwise Operators in C programming are essential for performing operations directly on bits, making them powerful for low-level programming and optimization tasks. These operators are a frequent topic in programming questions and answers for placement exams and technical interviews by companies like Infosys, Wipro, and TCS. This section on C bitwise operators questions with answers explains AND, OR, XOR, NOT, shift operators, and their practical applications. Practicing C programming MCQs on bitwise operations will enhance your problem-solving efficiency and understanding of memory-level computation in C.
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