 #include <stdio.h>
int main()
{
    long long n;
    int count = 0;

    printf("Enter an integer:");
    scanf("%lld", &n);

    while(n != 0)
    {
        // n = n/10
        n /= 10;
        ++count;
    }

    printf("Number of digits: %d",count);
}

ce7ccd81c1384ad5f38f2949474dfe625e92f4fb
 #include <stdio.h>
int main()
{
    long long n;
    int count = 0;

    printf("Enter an integer:");
    scanf("%lld", &n);

    while(n != 0)
    {
        // n = n/10
        n /= 10;
        ++count;
    }

    printf("Number of digits: %d",count);
}
