ProgrammingModerate
In ASCII, what is 'k' ^ 32 as a character?
- A. 'k'
- B. '0'
- C. '\n'
- D. 'K' (uppercase)
Correct answer: D. 'K' (uppercase)
Bit 5 (value 32) is the case bit for ASCII letters, so XOR with 32 toggles case: 'k' becomes 'K'.
More C Programming questions
- In a 32-bit unsigned int, what is (~0u) >> 28?
- What value does a[i] ^= a[j] leave when i and j refer to the same element?
- Which expression sets bit 31 of an unsigned 32-bit variable x with no undefined behaviour?
- The sequence n ^ (n >> 1) for n = 0, 1, 2, 3 gives what list?
- For positive values below 2^31, which product is guaranteed to fit in a signed 64-bit integer?
- What is the multiplicative inverse of 2 modulo 7?