How to use sum of this series in c language

Sum of Series

On this page

Sum of Series

Program to use Sum of this Series in C Language

#include <stdio.h>
int main()
{
  int i, n, sum = 0, term = 1;
  printf("Enter Number of Terms : ");
  scanf("%d", &n);
  for (i = 1; i <= n; i++)
  {
      sum += term;
      term = term + i;
  }
  printf("The Sum of Series upto %d Term is %d\n", n, sum);
  return 0;
}

Output

Enter Number of Terms : 3
The Sum of series upto 3 Term is 7