/************************************************
* Program to find the sum of the digits of a number
*************************************************/
#include<stdio.h> // include stdio.h
int main()
{
int n, remainder, sum = 0;
printf("Enter a number: \n");
scanf("%d", &n);
while(n != 0)
{
remainder = n % 10;
sum += remainder;
n = n / 10;
}
printf("sum = %d", sum);
return 0;
}