Answer Posted / anil kumar nahak
void main()
{
int n,i,sum=0,r;
printf("enter the value");
scanf("%d",&n);
while(n>0)
{
rem=num%10;
sum=sum+rem;
num=num/10;
}
printf("sum = %d",sum);
}
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
Why malloc is faster than calloc?
What are the complete rules for header file searching?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
What's the right way to use errno?
Write a program to print fibonacci series without using recursion?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is the equivalent code of the following statement in WHILE LOOP format?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
Why do we use pointer to pointer in c?
What is the meaning of && in c?
What is function prototype in c with example?
What is a constant?
What is ambagious result in C? explain with an example.
How is null defined in c?