Data Structures & AlgorithmsHardCodeforces Div2 C · GATE CS

How many positive integers x satisfy x^2 <= 500?

  1. A. 23
  2. B. 21
  3. C. 250
  4. D. 22

Correct answer: D. 22

22^2 = 484 and 23^2 = 529, so x runs from 1 to 22, giving 22 integers. Taking the square root of 500 and rounding down gives the same count.

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

Exams that ask this topic