Discussion
What is the value of the expression 13 | 25?
Answer: B
Correct answer: 29
OR compares the two numbers bit by bit and keeps a 1 where either has one:
13 = 0 1 1 0 1
25 = 1 1 0 0 1
--------------
| = 1 1 1 0 1The result 11101 is \( 16 + 8 + 4 + 1 = 29 \).
A useful check: OR can never produce a value smaller than either operand, since it only ever turns bits on, so an answer below 25 would be wrong on inspection alone. That rules out 9 - which is what & gives - and 20, which is ^, without any arithmetic.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development