Write code that prompts the user to enter a positive nonzero…
Write code that prompts the user to enter a positive nonzero number and validates the input. Print the number of digits that this number has. For example, the number 547 has 3 digits. To solve the problem, you must count how many times you can divide the number by 10 and get a nonzero remainder. For example, dividing 547 by 10 results in 54. Dividing 54 by 10 results in 5. Dividing 5 by 10 results in zero. You must use a loop for this problem.
Read Details