There are following categories of errors:
1. Syntax errors
2. Logical errors
3. Data errors
1. Syntax Errors
Syntax Errors in computer programs that typically involve incorrect punctuation, incorrect word sequence, undefined terms, or misuse of terms.
These errors are automatically detected, and pointed out by language processor.
RED A, B, C
PRINT X12 SUM
LET X = X/-Y
All have syntax errors. All such errors should be corrected before running the program.
2. Logical Errors
Errors like taking a wrong path, failure to consider a particular condition, incorrect order of evaluation of expressions, incorrect order of evaluation of statements, etc., belong to this category. These errors are primarily due to poor understanding of the problem, incorrect translation of algorithm into program and abuse of brackets and operators.
Writing IF A < B ….. in place of IF A > B
Writing IF X = Y ….. when X and Y are real numbers.
Are valid but might produce incorrect results. Sometimes such errors might create infinite loops.
3. Data Errors
Data errors are the most common errors. This may be due to wrong typing of constants, mismatching of variable list and data order, and failure to assume the range of values a variable might take in the program.
asking the computer to divide a quantity by zero, or to compute the square root of a negative number are due to failure to anticipate the ranges of data.