Difficulty: Easy
Correct Answer: A-4, B-3, C-1, D-2
Explanation:
Introduction / Context:
Programming interview and exam questions often test whether students can quickly recognize operator semantics. This item pairs common relational and bitwise shift operators with their meanings in C/C++ and many C-like languages.
Given Data / Assumptions:
Concept / Approach:
Identify the category first (relational vs. bitwise). Then map symbols to familiar English descriptions: != means “not equal to”; == means “equal to”; << and >> mean left and right bit shifts, respectively.
Step-by-Step Solution:
Verification / Alternative check:
Small test: 5 != 6 evaluates true; 5 == 6 evaluates false. For shifts, 1 << 3 equals 8 and 8 >> 2 equals 2, confirming the meanings.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing bitwise shifts with stream insertion/extraction operators in C++ iostreams; they reuse the symbols but are overloaded as functions, not fundamental shifts.
Final Answer:
A-4, B-3, C-1, D-2
Discussion & Comments