Sum of N natural Numbers
Submit solution
C
Points:
10 (partial)
Time limit:
15.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
Given a positive integer N as input. Print the sum of natural numbers upto N. When N<0 zero should be printed.
Sample Input
5
Sample Output
15
Explanation
Sum of natural numbers from 1 to 5 i.e.;(1+2+3+4+5) is 15.
Comments