C++ Saved Program: gifted-life

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


#include<stdio.h>
void main()
{
    int sum=0,i,no=5;
    printf("enter your number");
    scanf("%d",&no);
    for(i=0;i<=no;i++)
    {
        sum=sum+i;
    }
    printf("sum of %d natural number is %d",no,sum);
}
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs