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
#include
What is the difference between far and near ?
What is actual argument?
write a program to rearrange the array such way that all even elements should come first and next come odd
How can I find out the size of a file, prior to reading it in?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?
Explain zero based addressing.
Once I have used freopen, how can I get the original stdout (or stdin) back?
What are loops in c?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What is 2 d array in c?
What is difference between scanf and gets?
What is dynamic memory allocation?
What is the scope of an external variable in c?
Write a program to swap two numbers without using third variable?