ProgrammingHardGATE CS · Campus placements
What is (uint32_t)~0u >> 28?
- A. 16
- B. 255
- C. 7
- D. 15
Correct answer: D. 15
All 32 bits are set, and shifting right by 28 leaves the top four bits, which is 0xF = 15. The conversion to uint32_t keeps the width fixed.
More C Programming questions
- int g[2][3] = {1, 2, 3, 4}; What is g[1][1] + g[0][2]?
- uint8t a = 200; a = a + a; What is a?
- Which statement about pointer relations in C is well defined?
- How many subsets of {0, 1, 2, 3, 4, 5} contain exactly three elements?
- #define DOUBLE(x) (x + x). What does printf("%d", DOUBLE(2) 3) print?
- uint8t x = 0x90; uint8t y = x & (uint8t)(x - 1); What is y?