Difficulty: Easy
Correct Answer: A-3, B-2, C-1
Explanation:
Introduction / Context:
Operator literacy is central to reading C code quickly and safely. This match tests three frequently used operators that influence control flow, indexing, and arithmetic results.
Given Data / Assumptions:
Concept / Approach:
The ternary operator implements an inline conditional; the subscript operator indexes arrays/pointers; and the percent sign performs remainder arithmetic on integers. We map each symbol to its canonical description from the C grammar and standard library usage.
Step-by-Step Solution:
Verification / Alternative check:
Compile small snippets: int x = cond ? a : b; selects between values; arr[i] is *(arr + i); 7 % 3 yields 1 in C.
Why Other Options Are Wrong:
Common Pitfalls:
Assuming % is a true mathematical modulus for negatives—C defines remainder with implementation-defined sign rules in older standards; modern C17 specifies truncation toward zero.
Final Answer:
A-3, B-2, C-1
Discussion & Comments