You are on page 1of 1

/*A program to find the greatest digit */

#include <stdio.h>

int main()
{
int n,r,count=0;
printf("Enter a number");
scanf("%d",&n);
do
{
r=n%10;
count=count+1;
n=n/10;
}
while(n!=0);
printf("The total number of digit is %d",count);

return 0;
}

You might also like