5 XP challenge

Sum Counting Numbers

very easy
Build it yourself · 3 min
1 Learn2 Predict3 Solve

Task
Your mission

Return 1 + 2 + ... + n. When n=0, return 0. n is an integer from 0 to 30.

Examples

InputReturn
n = 00
n = 1

total: 0 → 1. The result is 1.

1

Your code

Write your answer inside Solution, then use return to send it back.

Try examples runs the public examples. Check my code checks your full answer and saves your completion.