how to check number of digits in the number. code example Example: find number of digits in a number floor(log10(n) + 1);