Data Structures & AlgorithmsHardGATE CS · ICPC regional

What is the value of 7^100 mod 9?

  1. A. 7
  2. B. 8
  3. C. 9
  4. D. 11

Correct answer: A. 7

7^3 = 343 is 1 modulo 9, so the powers of 7 repeat with period 3; since 100 = 3*33 + 1, the value equals 7^1 mod 9.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic