Solution: Let x = p/q be a rational number, such that the prime factorization of q is of the form 2m5n, where n, m are non-negative integers. Then x has a decimal expansion which terminates.
Example:

Since the denominator is of the form 2m x 5n, the rational number has a terminating decimal expansion.