Sum of Natural Numbers

5

1 votes
Problem

Given a natural number N, find the sum of all natural numbers from 1 to N.

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

For N=4, sum of all Natural Numbers from 1 to 4 is-

1+2+3+4 = 10

Editor Image

?