C Program to find first N terms of an A.P with starting value 'a' and common difference 'd' and find the sum

#include "stdio.h"
void main ()
{
  int a, n, d, nthterm, sum = 0;
  clrscr ();
  printf ("Program to find first N terms of an A.P and find the sum\n");
  printf ("Enter the value of N, A, D\n");
  scanf ("%d%d%d", &n, &a, &d);
  nthterm = a + (n-1) * d;
  while (a < = nthterm)
  {
    printf ("\n%d", a);
    sum = sum + a;
    a + = d;
  }
  printf ("\nSum = %d", sum);
  getch();
}