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


Please Help Members By Posting Answers For Below Questions

Explain how many levels deep can include files be nested?

629


Differentiate between functions getch() and getche().

625


please send me the code for multiplying sparse matrix using c

1728


What is the purpose of main() function?

660


How can you read a directory in a C program?

652






Why we write conio h in c?

568


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

626


How do you define a function?

584


How do I get an accurate error status return from system on ms-dos?

650


Can you please explain the difference between syntax vs logical error?

698


What are near, far and huge pointers?

649


Can you please explain the difference between exit() and _exit() function?

595


What are the differences between new and malloc in C?

611


What are c preprocessors?

680


Which header file is used for clrscr?

583