Sign in to run tests against edge cases and save your code automatically.
Problem Description
Easy
Sum of Squares
Iteration & Loops
Count-controlled Loop
Accumulator
Write a program that inputs a positive integer `n` and outputs the sum of the squares of all whole numbers from 1 to `n` inclusive.
For example, if `n` is 3 the program calculates 1 + 4 + 9 and outputs 14.
Example Input
3
Example Output
14
Success Rate:
0% (0 passed / 0 attempted)
Code
Draft auto-saved
Test Results
Click "Test Code" to evaluate your code against the tests.