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 the use of define in c?
How can I call a function with an argument list built up at run time?
Which driver is a pure java driver
How is actual parameter different from the formal parameter?
Explain the difference between malloc() and calloc() in c?
Explain can static variables be declared in a header file?
What are different types of pointers?
Why is c still so popular?
What is assignment operator?
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
Do you have any idea how to compare array with pointer in c?
What does 1f stand for?
What is wrong in this statement?
What is mean by data types in c?
what do u mean by Direct access files? then can u explain about Direct Access Files?