#include <stdio.h>

int main() {
    int limit,i,s=0;
    printf("\nEnter how many natural no you wanna to sum:\n");
    scanf("%d",&limit);
    for(i=1;i<=limit;i++)
    {
        printf("\t%d",i);
        s=s+i;
    }
    printf("\n Sum of %d natural no is %d",limit,s);
    return 0;
}

Embed on website

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