#include <stdio.h>

int main() {
    int n=10,i,sum;
    printf ("Enter the number:%d\n",n);
    scanf ("%d\n",&n);
    for (i=1;i<=n;i++)
    sum+=i;
    printf ("sum of n natural numbers:%d\n",sum);
    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: