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
What is the difference between %d and %i?
What is the difference between #include
Do pointers store the address of value or the actual value of a variable?
Is c easy to learn?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
Why do some versions of toupper act strangely if given an upper-case letter?
What is sizeof in c?
What is class and object in c?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
What is extern variable in c with example?
What are actual arguments?
Can we access the array using a pointer in c language?
What is malloc calloc and realloc in c?
What is substring in c?