C program to add all the digits of a number and print the sum.
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c,d,x;
clrscr();
printf("Enter a five digit number: ");
scanf("%d",&x);
a=x%10; x/=10;
b=x%10; x/=10;
c=x%10; x/=10;
d=x%10; x/=10;
printf("\nSum of all the digits of the number is %d",a+b+c+d+x);
return 0;
}