You mean you want to use the program's logic to figure out how many digits the user entered, right?

There are a number of ways. The simplest that occurs to me is to first accept the number as a...