Exerpad
Exercise 4 · Chapter: For LoopsRequired+50 XP

Sum 1 to N

Read a number N, then print the sum of all numbers from 1 to N.

Example:

Input:

5

Output:

15
Need a hint?
3 available · costs 5 XP each
javascript

Output
Run your code to see the output here.