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 context in c?
What is the purpose of realloc()?
What is a pointer and how it is initialized?
What are the main characteristics of c language describe the structure of ac program?
What is the difference between new and malloc functions?
write a program to find out prime number using sieve case?
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
What does the c in ctime mean?
What are dangling pointers? How are dangling pointers different from memory leaks?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
Explain the ternary tree?
What is assignment operator?
What is advantage of pointer in c?
What is bin sh c?
what is the significance of static storage class specifier?