Three types of errors can occur during the execution of a computer program. These are:
- Logical errors – This occurs in the scenario of a computer program implementing the wrong logic. As there is no report generated for these types of programming errors, they are the most difficult ones to deal with.
- Runtime errors – Occurs when the program contains an illegal operation. For example, dividing a number by 0. These are the only errors that are displayed instantly during the program execution. Upon the occurrence of a runtime error, the program execution is stopped and a diagnostic message is displayed.
- Syntax errors – Occurs when one or more grammatical rules of the programming language being used is violated. Such errors are detected during compile time.