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 function pointer c?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What are the advantages and disadvantages of c language?
Explain what are multidimensional arrays?
What are the applications of c language?
What is floating point constants?
Difference between constant pointer and pointer to a constant.
What are loops in c?
If null and 0 are equivalent as null pointer constants, which should I use?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
What is nested structure with example?
What are multibyte characters?
Explain modulus operator. What are the restrictions of a modulus operator?
What are operators in c?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon