Programming Code Center(PCC)
[C]

(PCC)::[How-to-write-a-C-Program-to-Count-Number-of-Digits-in-an-Integer]::[c]

File Name : Count_Number_of_Digits.c

//Program to Count the Number of Digits
#include <stdio.h>
int main() {
    long long n;
    int count = 0;
    printf("Enter an integer: ");
    scanf("%lld", &n);

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

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

Output :

Count_Number_of_Digits.jpg