Data Structures & AlgorithmsHardGATE CS · ICPC regional

What is 2^100 mod 9?

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

Correct answer: A. 7

The powers of 2 mod 9 repeat with period 6, and 100 mod 6 = 4, so 2^100 is congruent to 2^4 = 16, which is 7 modulo 9.

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

Exams that ask this topic