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
Write a program to reverse a given number in c language?
How can I write a function analogous to scanf?
how to capitalise first letter of each word in a given string?
What does 1f stand for?
How can I do peek and poke in c?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }
Why we use conio h in c?
What are the 32 keywords in c?
Explain how do you list a file’s date and time?
What are valid signatures for the Main function?
What is null character in c?
Can you please compare array with pointer?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
What is return type in c?