ProgrammingVery hardProduct-company MCQ pattern

What is printed?

What is printed?
print(int('9' * 5) ** 2 // 10**9, (10**9 - 1) ** 2 // 10**9)
  1. A. 9 999999999
  2. B. 8 999999998
  3. C. 9 1000000000
  4. D. 9 999999998

Correct answer: D. 9 999999998

99999 squared is 9999800001, and dividing by 10**9 floors to 9. (10**9 - 1) squared is 10**18 - 2 * 10**9 + 1, which floors to 999999998.

More Python Programming questions

Exams that ask this topic