Back To C Loops Index
//program to input a number and count number of digits in the number #include
#include
void main() { int num,digit; int count=0; clrscr(); printf("\nenter the number "); scanf("%d",&num); do { digit=num%10; num=num/10; count++; }while(num!=0); printf("\nthe number of digits in the number are %d",count); getch(); }