What is the best method to find the number of digits of a positive integer?
I have found this 3 basic methods:
conversion to string
Keep it simple:
long long int a = 223452355415634664; int x; for (x = 1; a >= 10; x++) { a = a / 10; } printf("%d", x);