ProgrammingModerateTCS NQT · Infosys

uint64_t mask = (1ULL << 40) - 1; What is mask?

  1. A. 1099511627776
  2. B. 1048575
  3. C. 2199023255551
  4. D. 1099511627775

Correct answer: D. 1099511627775

(1 << 40) - 1 is the 40 low bits set, which is 1099511627775. The off-by-one forms 1099511627776 and 2199023255551 are the common errors.

More C Programming questions

Exams that ask this topic