Commerce

Bitwise And Boolean MCQs

Practice Bitwise And Boolean MCQs for competitive exams.

Bitwise And Boolean MCQs

Practice questions from this topic.

Which of the following expressions can be used to multiply a given number 'a' by 4?

  1. A. a<<2
  2. B. a<<4
  3. C. a>>2
  4. D. a>>4
Report Error

What will be the output of the following Python expression? 4^12

  1. A. 2
  2. B. 4
  3. C. 8
  4. D. 12
Report Error

What will be the output of the following Python code? if (9 < 0) and (0 0) or False: print("good") else: print("bad")

  1. A. error
  2. B. hello
  3. C. good
  4. D. bad
Report Error

What will be the output of the following Python code snippet? ['hello', 'morning'][bool('')]

  1. A. error
  2. B. no output
  3. C. hello
  4. D. morning
Report Error

What will be the value of the following Python expression? bin(10-2)+bin(12^4)

  1. A. 0b10000
  2. B. 0b10001000
  3. C. 0b1000b1000
  4. D. 0b10000b1000
Report Error

What is the value of the following Python expression? bin(0x8)

  1. A. '0bx1000'
  2. B. 8
  3. C. 1000
  4. D. '0b1000'
Report Error

What is the result of `(8 >> 2) | (1 << 2)` ?

  1. A. 10
  2. B. 5
  3. C. 9
  4. D. 4
Report Error

What will be the output of the following Python code if the system date is 21st June, 2017 (Wednesday)? [] or {} {} or []

  1. A. [] {}
  2. B. [] []
  3. C. {} []
  4. D. {} {}
Report Error

What is the result of `(4 | 2) & 6` ?

  1. A. 0
  2. B. 6
  3. C. 2
  4. D. 4
Report Error

Which of the following Boolean expressions is not logically equivalent to the other three?

  1. A. not(-610)
  2. B. -6>=0 and -6<=10
  3. C. not(-6<10 or-6==10)
  4. D. not(-6>10 or-6==10)
Report Error

What will be the output of the following Python code snippet? not(3>4) not(1&1)

  1. A. True True
  2. B. True False
  3. C. False True
  4. D. False False
Report Error

Any odd number on being AND-ed with . . . . . . . . always gives 1. Hint: Any even number on being AND-ed with this value always gives 0.

  1. A. 10
  2. B. 2
  3. C. 1
  4. D. 0
Report Error