Sum of Series 1 to N Problem

Sum of Series 1 to N Problem — ExecCode School DSA Practice

Solve the Sum of Series 1 to N problem on ExecCode. Free online school DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.

Problem description

You are given a whole number N. Your task is to solve Sum of Series 1 to N. Add all whole numbers from 1 to N and print the sum.

Examples

Input 1; Output 1. Input 5; Output 15

Constraints

1 <= n <= 10^5

Practice Sum of Series 1 to N free on ExecCode. Browse DSA problems, topic map, and placement guides.