calculate the serics of 1+2+3+…+n


//calculate the serics of 1+2+3+…+n
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,sum=0;
printf("Please enter the value of n :");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
sum=sum+i;
}
printf("The total sum = %d",sum);
}