answersLogoWhite

0

# 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

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

RossRoss
Every question is just a happy little opportunity.
Chat with Ross
JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan
SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve

Add your answer:

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