How to prevent logic errors
To prevent logic errors, you should:
- Make certain that you do understand how the program is
supposed to behave.
- Make certain that you understand the behavior of every
operation that you write into your program.
- Not be careless.
- Implement a practice of testing, testing, and testing.