|
The types of errors are syntax error, logical error, and runtime error.- Syntax error results from the violation of the grammar (syntax) of C language. In the process of syntax errors, the program will not compile.
- Logical errors result from the wrong logic that in turn result from the poor understanding of the problem under consideration. Even in the process of logical errors, the program will run but the results will be incorrect. These errors are most difficult to locate particularly if the problem is large and complex.
- Runtime errors result either from non availability of the resource required such an attempt to open/read from a non existing data file or memory allocation failure, etc. or an attempt to perform an illegal operation such as division by zero, taking square root or logarithm of a negative number etc. In the presence of these errors, the program will terminate prematurely, i.e., before finishing its intended task. Premature termination is also known as abnormal terminal.
- Errors are also known as bugs.
|