Sum of N natural numbers


Submit solution

Points: 10 (partial)
Time limit: 8.0s
Memory limit: 64M

Authors:
Problem type
Allowed languages
C

Problem Statement

Given a positive integer N as input, print the sum of natural numbers up to N. When N is less than or equal to 0, 0 should be printed

Sample Input

5

Sample Output

15

Explanation

Sum of natural numbers from 1 to 5 is 15


Comments

There are no comments at the moment.