Example 2

Here I have used two variables, called x and y. I perform the same calculation three times, namely x divided by y, changing the values of x and y each time:

In that last example, one number was divided by 0, giving a rather peculiar result! Why do you think this occurred?

Look at the source code and match each of the document.write() instructions in the program with one of the lines that you see above.