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
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
Differentiate between static and dynamic modeling.
how do you execute a c program in unix.
Do you know pointer in c?
What is the difference between text and binary i/o?
Why doesnt long int work?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
write a program to display all prime numbers
Explain what is #line used for?
Write a program to identify if a given binary tree is balanced or not.
What are the 5 data types?
What is the g value paradox?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
write a program to create a sparse matrix using dynamic memory allocation.
What are high level languages like C and FORTRAN also known as?