#include <stdio.h> int main() { int sum = 0, num = 1, n; scanf("%d", &n); while (num <= n){ sum += num; num++; } printf("%d", sum); return 0; }
To embed this project on your website, copy the following code and paste it into your website's HTML: