Sum of squares of numbers from 1 to N
C#
Easy
loops
Task «Sum of squares of numbers from 1 to N»
Write a program that reads a positive integer N and calculates the sum of squares of all integers from 1 to N inclusive. Use a for loop. It is guaranteed that N does not exceed 1000.
Input Format
One positive integer N.
Output Format
One integer — the sum of squares of numbers from 1 to N.
Examples
Example 1
INPUT
5
12 34 21 43 15
OUTPUT
55
Example 2
INPUT
1
OUTPUT
1
Example 3
INPUT
3
5 10 15
OUTPUT
14
main.cs