CommerceBitwise And Boolean MCQs
Practice Bitwise And Boolean MCQs for competitive exams.
Bitwise And Boolean MCQs
Practice questions from this topic.
What will be the output of the following Python expression? ~100?
- A. 101
- B. -101
- C. 100
- D. -100
Correct Answer: B
What will be the output of the following Python code? class Truth: pass x=Truth() bool(x)
- A. pass
- B. true
- C. false
- D. error
Correct Answer: B
What is the result of `10 & 5 | 5` ?
- A. 5
- B. 10
- C. 0
- D. 15
Correct Answer: A
What is the result of 12 >> 2 ?
- A. 3
- B. 6
- C. 12
- D. 48
Correct Answer: A
What is the result of 5 & 6 ^ 6 ?
- A. 6
- B. 5
- C. 0
- D. 1
Correct Answer: C
Bitwise . . . . . . . . gives 1 if either of the bits is 1 and 0 when both of the bits are 1.
- A. OR
- B. AND
- C. XOR
- D. NOT
Correct Answer: C
It is not possible for the two's complement value to be equal to the original value in any case.
- A. True
- B. False
Correct Answer: B
What is the result of `12 | 10 & 9` ?
- A. 12
- B. 10
- C. 9
- D. 8
Correct Answer: A
What is the result of not (10 > 5) ?
- A. True
- B. False
- C. None
- D. Error
Correct Answer: B
What is the result of 9 ^ (5 & 3) ?
- A. 8
- B. 7
- C. 1
- D. 2
Correct Answer: C
To find the decimal value of 1111, that is 15, we can use the function:
- A. int(1111,10)
- B. int('1111',10)
- C. int(1111,2)
- D. int('1111',2)
Correct Answer: D
What will be the output of the following Python expression? bin(29)
- A. '0b10111'
- B. '0b11101'
- C. '0b11111'
- D. '0b11011'
Correct Answer: B