wap in c to accept a number display the total count of digit
Answer Posted / vaibhav
#include<stdio.h>
#include<conio.h>
void main()
{
int no,t,cnt=0;
clrscr();
printf("\n enter the no.");
scanf("%d",&no);
while(no!=0)
{
t=no%10;
no=no/10;
cnt++;
}
printf("\nTotal count of digit is%d",cnt);
getch();
}
Is This Answer Correct ? | 19 Yes | 4 No |
Post New Answer View All Answers
Explain how many levels deep can include files be nested?
Differentiate between functions getch() and getche().
please send me the code for multiplying sparse matrix using c
What is the purpose of main() function?
How can you read a directory in a C program?
Why we write conio h in c?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
How do you define a function?
How do I get an accurate error status return from system on ms-dos?
Can you please explain the difference between syntax vs logical error?
What are near, far and huge pointers?
Can you please explain the difference between exit() and _exit() function?
What are the differences between new and malloc in C?
What are c preprocessors?
Which header file is used for clrscr?