The source of the error
The statement that produced the error is shown in boldface in Listing 2.
(Although the code contains some elements that we haven't studied in detail yet, the meaning of the code will probably be intuitively obvious to most students.)
The program creates two variables named temp1 and temp2 in the function named doSomething. It stores a value of 6 in temp1 and a value of 0 in temp2.
Then it attempts to use the divide operator (/) to divide temp1 by temp2. However, because the division of any value by 0 produces an infinite result, the program terminates with a runtime error.