ProgrammingVery hard
What is the result of (0xFFu >> 4) | (0x0Fu << 4) & 0xFF?
- A. 240
- B. 15
- C. 255
- D. 16
Correct answer: C. 255
The shift and the & bind as written: (0xFF >> 4) = 15 and (0x0F << 4) & 0xFF = 240. Their OR is 255.
More C Programming questions
- How many times does cnt++ run in: for (i = 0; i < 10; i++) for (j = i; j < 10; j++) cnt++; ?
- How many iterations does for (i = 1; i < 1024; i = 2) do?
- A binary search over n = 10^6 sorted records, in the worst case, takes how many loop iterations?
- A sieve of Eratosthenes up to n = 100 marks composites by starting each prime p at pp, and only for pp <= n. How many marking operations…
- With fib(1) = fib(2) = 1, what is the largest n for which fib(n) fits in a signed 64-bit long long?
- A loop appends one character to a string with strcat(s, "x") for n = 10^5 times. Each strcat calls strlen on the whole string first. What…