Write a program that outputs the sum from 1 to N when a natural number N is input.
A natural number N less than or equal to 20 is entered in the first line.
6
10
Prints the sum from 1 to N on the first line.
21
55
for
function solution(n) {
let answer = 0;
for (let i = 1; i <= n; i++) {
answer += i;
}
return answer;
}