ExamVeda
Login
Home
1
What is the result of 5 & 3 ?
Discuss
Answer & Solution
Answer: Option B
Solution:
The & operator performs bitwise AND on the binary representations of the numbers.
2
What is the result of `6 | 3` ?
Discuss
Answer & Solution
Answer: Option D
Solution:
The bitwise OR operator (|) performs a bitwise OR operation on each corresponding bit of the two numbers. In this case, the binary representation of 6 is 110, and the binary representation of 3 is 011. When performing a bitwise OR, if any of the corresponding bits is 1, the result bit will be 1; otherwise, it will be 0. So, performing 6 | 3 results in 111, which is 7 in decimal notation. Therefore, the correct answer is Option D.
3
What is the result of 10 ^ 6 ?
Discuss
Answer & Solution
Answer: Option B
Solution:
The ^ operator performs bitwise XOR on the binary representations of the numbers.
4
What is the result of 5 << 2 >> 1 ?
Discuss
Answer & Solution
Answer: Option B
Solution:
The << and >> operators are evaluated from left to right.
5
What is the result of `(6 | 3) ^ 5` ?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
6
What is the result of 7 << 2 ?
Discuss
Answer & Solution
Answer: Option A
Solution:
The << operator performs left shift, shifting the bits to the left.
7
What will be the value of x in the following Python expression, if the result of that expression is 2?
x>>2
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
8
Which of the following represents the bitwise XOR operator?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
9
What is the result of ~(6 & 3) ?
Discuss
Answer & Solution
Answer: Option C
Solution:
The ~ and & operators are evaluated from left to right.
10
What is the result of True ^ False ?
Discuss
Answer & Solution
Answer: Option A
Solution:
The ^ operator performs bitwise XOR on the boolean values, resulting in True.