C Program to find the sum of digits of a number
# include<stdio .h="">
# include<conio .h="">
void main()
{
int num,sum=0,rem=0;
clrscr();
printf("\n Enter a number:");
scanf("%d",&num);
while(num>0)
{
rem=num%10;
sum=sum+rem;
num=num/10;
}
printf("\n Sum of digits of a number:%d",sum);
getch();
}
***********OUTPUT**************
Enter a number:56
Sum of digits of a number:11</conio></stdio>