ProgrammingModerateTCS NQT · Infosys
What is printed?
What is printed?
print(10 ** 18 * 10 ** 18 // 10 ** 35, 2 ** 64 // 2 ** 32, 2 ** 64 % 2 ** 32)
- A. 10 4294967296 4294967296
- B. 10 4294967296 0
- C. 9 4294967296 0
- 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
- What is printed? python x = 1 << 200 print(x.bitlength(), len(str(x)), x % 1000, (x >> 190) & 0xFF)
- What is printed? python print(f'{210:,}', f'{210:x}', f'{210:b}', f'{-210:>8}'.strip())
- What is printed? python print(str(round(2.5)), str(round(3.5)), round(2.5 + 0.0001), round(-2.5 - 0.0001))
- What is printed? python s = 'ab' 2 + 'c' print(s.endswith('bc'), s.startswith('ab', 2), s.find('ab', 1), s.count('ab'))
- What is printed? python print(len(''.join(str(i) for i in range(1, 11))), ''.join(str(i) for i in range(1, 11))[-3:], sum(len(str(i)) for…
- What is the time complexity of checking whether a number n is prime by trial division up to its square root?