ProgrammingModerateTCS NQT · Infosys

What is printed?

What is printed?
print(10 ** 18 * 10 ** 18 // 10 ** 35, 2 ** 64 // 2 ** 32, 2 ** 64 % 2 ** 32)
  1. A. 10 4294967296 4294967296
  2. B. 10 4294967296 0
  3. C. 9 4294967296 0
  4. D. 10 2147483648 0

Correct answer: B. 10 4294967296 0

10**18 * 10**18 is 10**36, and dividing by 10**35 gives 10. 2**64 divided by 2**32 is 2**32 exactly, so the remainder is 0.

More Python Programming questions

Exams that ask this topic