ProgrammingVery hardGATE CS · Campus placements

What is the value of (1ULL << 63) >> 62 for uint64_t arithmetic?

  1. A. 2
  2. B. 1
  3. C. 4
  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

Exams that ask this topic