C Program to find the sum of digits of number until the sum becomes the single digit

#include "stdio.h"
void sum (int);
void main ()
{
  int num;
  clrscr ();
  printf ("Enter the number\n");
  scanf ("%d", &num);
  sum (num);
  getch ();
}
void sum (int n)
{
  int a, s = 0;
  while (n > 0)
  {
    a = n % 10;
    s = s + a;
    n = n / 10;
  }
    if (s > 9)
    {
      sum (s);
    }
    else
    printf ("Last value of sum of the digits is %d", s);
}