A logic error

The program in Listing 3 illustrates a simple logic error.  The intent of the program was for the program to display the following text:

Hello World

However, a programming logic error causes the program to display the following text instead:

Goodbye Cruel World

Note that most logic errors are more subtle than this one and are much more difficult to find and fix.