Program to find the sum of digits of a given number until
the sum becomes a single digit
Answer Posted / sohini khan
main()
{int n,p,s=0;
while(n>0)
{
p=n%10;
s=s+p;
n=n/10;
}
printf("%d",s);
getch(),
}
Is This Answer Correct ? | 29 Yes | 43 No |
Post New Answer View All Answers
explain what is an endless loop?
How do you determine the length of a string value that was stored in a variable?
What is the difference between exit() and _exit() function?
What is a static variable in c?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
What is the method to save data in stack data structure type?
What does %p mean c?
Add Two Numbers Without Using the Addition Operator
What do you mean by dynamic memory allocation in c?
What is array of structure in c programming?
What is bash c?
Explain what is meant by 'bit masking'?
which type of aspect you want from the student.
What is && in c programming?
What is maximum size of array in c?