Add first n natural numbers
Submit solution
C
Points:
10 (partial)
Time limit:
5.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
To add first n natural numbers
Sample input
5
Sample Output
15
Sample input
0
Sample output
0
Sample input
-5
Sample output
0
Comments
include <stdio.h>
int main() { int n, i, sum = 0;
}