wap in c to accept a number display the total count of digit
Answer Posted / govind279
#include<stdio.h>
int main()
{
int n,m,sum=0;
scanf("%d",&n);
for(m=0;((m=n%10)!=0);n=(n/10))
sum+=m;
printf("count is %d\n",sum);
}
| Is This Answer Correct ? | 14 Yes | 10 No |
Post New Answer View All Answers
What is a pragma?
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
Is null equal to 0 in sql?
What is identifier in c?
How do you use a pointer to a function?
What is the total generic pointer type?
what are the different storage classes in c?
What is calloc malloc realloc in c?
Explain a file operation in C with an example.
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
What is the stack in c?
How can my program discover the complete pathname to the executable from which it was invoked?
How can I get the current date or time of day in a c program?
What is #line?
Who is the founder of c language?