Answer:
Step-by-step explanation:
#include
int main()
{
int n, sum = 0;
printf("Enter a five digit number: ");
scanf("%d", &n);
while (n != 0) {
sum = sum + n % 10;
// removing last digit from number
n /= 10;
}
printf("Sum of digits: %d",sum);
return 0;
}