ProgrammingVery hardTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(pow(7, 222, 13), pow(7, 6, 13))
  1. A. 6 12
  2. B. 12 12
  3. C. 1 12
  4. D. 12 1

Correct answer: B. 12 12

7 has order 12 modulo 13, and 7^6 is -1 mod 13, which is 12. Since 222 mod 12 = 6, the first value is 12 too.

More Python Programming questions

Exams that ask this topic