ProgrammingVery hardGATE CS · Campus placements
What is the value of (1ULL << 63) >> 62 for uint64_t arithmetic?
- A. 2
- B. 1
- C. 4
- D. 0
Correct answer: A. 2
The set bit 63 moves to bit 1 after shifting right by 62, which is the value 2. The shift count stays below the width of uint64_t, so it is defined.
More C Programming questions
- uint8t a = 200, b = 250; uint8t avg = (a + b) / 2; What is avg?
- What is the value of 1 + 2 3 << 1 in C?
- How many positive divisors does 40 have?
- int next(void) { static int c = 0; return ++c; } Each of three calls returns its value, and the three returns are added together. What is…
- char s[] = "a0b"; What is strlen(s)?
- uint32t v = 0; for each digit d of the decimal string "4294967296", v = v 10 + d; What is v at the end?