A divide by zero error

The program in Listing 2 produces a runtime error when an attempt is made to divide by a variable containing a value of zero.