answersLogoWhite

0


Best Answer

# include <stdio.h> main()

{

int num,count,sum;

count=0;

sum=0;

printf("enter an integer :");

scanf("%d",&num);

printf("ur num is : %d \n",num);

while (num!=0)

{

count++;

sum+=num%10;

num/=10;

}

printf("sum of the digits is : %d",sum);

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Sum of digits
Write your answer...
Submit
Still have questions?
magnify glass
imp