(PCC)::[How-to-write-a-C-Program-to-Count-Number-of-Digits-in-an-Integer]::[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); }