Answer Posted / pooja
main()
{
int n,i,sum=0,r;
printf("enter the value");
scanf("%d",&n);
while(n!=0)
{
r=n%10;
n=n/10;
sum=sum+r;
}
printf("\nsum of digits is %d",sum);
}
| Is This Answer Correct ? | 57 Yes | 11 No |
Post New Answer View All Answers
Explain what are global variables and explain how do you declare them?
What is data structure in c language?
What is variable declaration and definition in c?
What does volatile do?
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
What is a header file?
Is a pointer a kind of array?
Under what circumstances does a name clash occur?
How do I determine whether a character is numeric, alphabetic, and so on?
What is fflush() function?
How can I discover how many arguments a function was actually called with?
How can I send mail from within a c program?
Describe the steps to insert data into a singly linked list.
Explain what does it mean when a pointer is used in an if statement?
What's the best way of making my program efficient?