If the number is 0594 the total number of digit should be 4,how to solve it? :  1. If the no taken is "06584" the output would be "4",excluding ZERO.
 2. But,how to get "5" as output counting even ZERO as a digit?
 Below is the code.

    #include<stdio.h>
    void main()
    {
	int n,c=0,d;
	printf("Enter no\n");
	scanf("%d",&n);
	while(n!=0)
	{
		d=n%10;
		c++;
		n=n/10;
	}
	printf("No of digits=>%d\n",c);
}
