Answer Posted / pankaj khaitan
main()
{
int n,i,sum=0,r;
printf("enter the value");
scanf("%d",&n);
while(n)
{
rem=num%10;
sum=sum+rem;
num=num/10;
}
printf("sum = %d",sum);
}
Is This Answer Correct ? | 40 Yes | 15 No |
Post New Answer View All Answers
What is the difference between a function and a method in c?
What are c preprocessors?
What are the scope of static variables?
What is optimization in c?
Explain about the constants which help in debugging?
What are the keywords in c?
Why C language is a procedural language?
Explain how do you list a file’s date and time?
Can a pointer point to null?
Give me the code of in-order recursive and non-recursive.
What are the advantages of union?
What is the heap in c?
What does & mean in scanf?
What are c header files?
Explain what are the different file extensions involved when programming in c?