Adding Numbers
Write a program that,
given a number N,
will calculate the sum of all numbers in the range [1..N].
Your program must give correct results for N up to 100,000.
given a number N,
will calculate the sum of all numbers in the range [1..N].
Your program must give correct results for N up to 100,000.
Sample Output
Example input
5
Example output
15
Example input
124
Example output
7750
Example input
10000
Example output
50005000
5
Example output
15
Example input
124
Example output
7750
Example input
10000
Example output
50005000