Program:

#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
{
 char ch;
 int asc;
 int sum = 0;
 clrscr();
 printf("Enter a character : ");
 scanf("%c", &ch);
 asc = toascii(ch);
 printf("\nThe ASCII value of %c is %d", ch, asc);
 while (asc > 0)
 {
  sum = sum + (asc % 10);
  asc = asc / 10;
 }
 printf("\nThe sum is %d", sum);
 getch();
}