What am i doing wrong in this code ? There are no errors but if i enter a 4 digit number the output it is 1272 !!
#include<conio.h>
#include<stdio.h>
void main()
{
    int i,n=0;
    clrscr();
    printf("Enter a number");
    scanf("%d",&i);
    while(i>=9)
    {
        i=i/10;
        n++;
    }
    n++;
    printf("This is a %d digit number",n);
    getch();
}
 
     
    