C- Bitwise Operators Questions and Answers

Take Exam

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
Show Answer Report

2. Which bitwise operator is suitable for turning off a particular bit in a number?

  • && operator
  • & operator
  • || operator
  • ! operator
Show Answer Report

3. Which bitwise operator is suitable for turning on a particular bit in a number?

  • && operator
  • & operator
  • || operator
  • | operator
Show Answer Report

4. Which bitwise operator is suitable for checking whether a particular bit is on or off?

  • && operator
  • & operator
  • || operator
  • ! operator
Show Answer Report

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
Show Answer Report

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
Show Answer Report

7. What is the result of 8 >> 1 in C?

  • 16
  • 8
  • 4
  • 2
Show Answer Report

8. Which operator is used for left shift in C?

  • >>
  • <<
  • >>>
  • ><
Show Answer Report

9. What is the output of: printf("%d", 10 | 5);

  • 5
  • 10
  • 15
  • 20
Show Answer Report

10. What does the bitwise complement operator (~) do?

  • Increments the value
  • Flips all bits
  • Decrements the value
  • Doubles the value
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test