Q) C program to count the number of digits in a number using while loop.
Sol)
#include<stdio.h>
int main()
{
int num,count=0;
printf("Enter a number : ") ;
scanf("%d",&num);
while(num)
{
num=num/10;
count++ ;
}
printf("\nTotal digits is : %d",count) ;
return 0;
}