The expression n & 1 evaluates to 1 exactly when n is odd.
Answer: A
Correct answer: True
The least significant bit carries the value 1, so it is set precisely for odd numbers. Masking with 1 is therefore a faster parity test than taking the remainder, and unlike the remainder operator it behaves the same for negative values in two’s complement.
Please log in or register to report this question.