int mcc_get_number_of_digits(int input) { int digits = 0; while (input != 0) { input /= 10; digits++; } return digits; }