Iterated Sums
CodeChefOpen on judge ↗
Please compute the sum of squares for the given numbers: a, a+1, ..., b-1, b. Input : Two numbers: a and b separated by space, where 1 <= a <= b <=50. Output : Computed sum: a*a + (a+1)*(a+1) + ... + (b-1)*(b-1) + b*b Example 1 : Input : 1 4 Output: 30 Example 2 : Input: 5 6 Output: 61
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start