#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,sum=0;
clrscr();
printf("\n enter the number");
scanf("\n %d",&n);
for(i=1;i<=n;i++)
{
sum=sum+i;
}
printf("\n the sum is %d",sum);
getch();
}
#include<conio.h>
void main()
{
int i,n,sum=0;
clrscr();
printf("\n enter the number");
scanf("\n %d",&n);
for(i=1;i<=n;i++)
{
sum=sum+i;
}
printf("\n the sum is %d",sum);
getch();
}