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 does sizeof return c?
Explain what is the benefit of using const for declaring constants?
what do u mean by Direct access files? then can u explain about Direct Access Files?
What is a function in c?
Explain the Difference between the New and Malloc keyword.
Which control loop is recommended if you have to execute set of statements for fixed number of times?
What does the message "automatic aggregate intialization is an ansi feature" mean?
What is ambagious result in C? explain with an example.
Is main a keyword in c?
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
Can i use “int” data type to store the value 32768? Why?
if p is a string contained in a string?
What is the best way of making my program efficient?
Is malloc memset faster than calloc?
How do we make a global variable accessible across files? Explain the extern keyword?