Data Structures & AlgorithmsHardGATE CS · TCS NQT

What is the sum of the integers from 1 to 100 inclusive that are not perfect squares?

  1. A. 4666
  2. B. 4665
  3. C. 5050
  4. D. 385

Correct answer: B. 4665

The total of 1 to 100 is 5050, and the squares 1, 4, ..., 100 sum to 385. Subtracting gives 4665; the squares sum is the last option.

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

Exams that ask this topic