calc the number of digits code example Example: calc the number of digits int count = 0; int n = number; while (n != 0) { n /= 10; cout++; }