ProgrammingHard
What is the value of 5 & 6 | 3 in C?
- A. 0
- B. 3
- C. 7
- D. 6
Correct answer: C. 7
& binds tighter than |, so the expression is (5 & 6) | 3 = 4 | 3 = 7.
More C Programming questions
- What is the value of 0x80 | 0x01 | 0x10 in decimal?
- What is printed? c #include <stdint.h> #include <stdio.h> int main(void) { uint8t a = 0xB6; uint8t b = (uint8t)(a << 3); uint8t c = a >>…
- Assume uint16t is 16 bits, unsigned int is 32 bits and int is 32 bits. What is printed? c #include <stdint.h> #include <stdio.h> int…
- What is printed? c #include <stdio.h> int calls = 0; int f(int n) { calls++; if (n < 2) return n; return f(n - 1) + f(n - 2); } int…
- A struct R has int16t score and uint8t id. After qsort with cmp below, what is printed? c #include <stdint.h> #include <stdio.h> #include…
- What is printed? c #include <stdint.h> #include <stdio.h> int main(void) { uint16t x = (uint16t)~0x00F0u; int c = 0; for (; x; x &= x - 1)…