//Count the total number of digits in a number using while loop
#include<stdio.h>
int main()
{
int n,count=0;
printf("Enter n= \n");
scanf("%d",&n);
while(n!=0)
{
count++;
n=n/10;
}
printf("Count = %d",count);
return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: