Data Structures & AlgorithmsHardGATE CS · Codeforces Div2 B

How many integers x in [1, 200] have x^2 mod 10 equal to 4?

  1. A. 41
  2. B. 42
  3. C. 44
  4. D. 40

Correct answer: D. 40

Squares end in 4 exactly when the last digit is 2 or 8, and each of these last digits occurs 20 times up to 200.

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

Exams that ask this topic