# Write a c program to compute the sum of digits of a given integer number?

int sumDigits(int n) { int sum = 0; while( n > 0 ) { sum += (n % 10); // add last digit of n to sum n /= 10; // divide n by 10 to "chop off" the last… digit } return sum; } ____________________________________________________ C program to find the sum of entered digit: By Jatinder Pal Singh #include<stdio.h>#include<conio.h>void main(){clrscr();int n,num,x,sum=0;printf("Enter a number=");scanf("%d",&n);while(n>0){x=n%10;sum=sum+x;n=n/10;}printf("Sum of digits of a number=%d",sum);getch();} (MORE)