Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- long long int n, sum = 0, i;
- scanf("%lld", &n);
- while (n >= 0)
- {
- sum = 1;
- for (i = 0; i <= n; i++)
- sum += i;
- printf("%lld\n", sum);
- scanf("%lld", &n);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment