#C6104. Sum of Natural Numbers
Sum of Natural Numbers
Sum of Natural Numbers
Given a positive integer ( N ), your task is to compute the sum of the first ( N ) natural numbers, i.e., ( S = 1 + 2 + \cdots + N ). The formula for computing ( S ) is given by:
[ S = \frac{N \times (N+1)}{2} ]
You are required to read the input from standard input (stdin) and output your result to standard output (stdout). The problem is straightforward and focuses on basic arithmetic operations.
inputFormat
The input consists of a single line containing one integer ( N ) (1 ( \leq N \leq 10^9 )), which represents the number up to which the sum of natural numbers is to be computed.
outputFormat
Output a single integer which is the sum of the first ( N ) natural numbers.## sample
5
15
</p>