Semantic Errors
- The third type of error is the semantic error.
- If there is a semantic error in your program, it will run successfully, in the sense that the computer will not generate any error messages, but it will not do the right thing.
- It will do something else. Specifically, it will do what you told it to do.
- The problem is that the program you wrote is not the program you wanted to write. The meaning of the program (its semantics) is wrong.
- It requires you to work backward by looking at the output of the program and trying to figure out what it is doing.
Next Section - Formal and Natural Languages