write a program to sum of its digit with using control
structure or with out using loop. for ex: let the number is
25634 then answer will be=2+5+6+3+4=20
Answer Posted / thiruapthi rao
// mainlogic
while(number>0)
{
remainder=number%10;
sum=sum+remainder;
number=number/10;
}
/*
number=123
sum=1+2+3=6
*/
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Write a program to know whether the input number is an armstrong number.
How can you convert integers to binary or hexadecimal?
What is the size of structure pointer in c?
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a
What does struct node * mean?
What is maximum size of array in c?
What is the use of the function in c?
List the different types of c tokens?
Write a program to find the biggest number of three numbers in c?
Are negative numbers true in c?
Write a program to check armstrong number in c?
Write a program to implement queue.
What language is windows 1.0 written?
What is meant by inheritance?
How can I find out how much free space is available on disk?