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
What is the Purpose of 'extern' keyword in a function declaration?
Why we use void main in c?
How can I find the modification date and time of a file?
What is dynamic variable in c?
Does c have function or method?
Can a function argument have default value?
what are bit fields in c?
How can I run c program?
What is function prototype?
Can we change the value of static variable in c?
How can I insert or delete a line (or record) in the middle of a file?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
What is the difference between void main and main in c?
What is console in c language?
What is spark map function?