You are on page 1of 1

Comparison between Syntax, Semantic and Logical error Among these three types of errors we can identify number

of difference such as, Syntax Cause because of error in the syntax of a sequence of characters or tokens Semantic Cause because of improper use of program statements
Table 1

Logical Caused because of wrong programming designing

Syntax errors are occurred when dont obey the syntax rules in programming. Semantic errors are occurred because of improper use if programming statements. But wrong programming designing is the main reason which leads as the reason for a logical error. Syntax Program will not compile until all syntax errors are corrected. Semantic Indicate that the statement is out of scope
Table 2

Logical Executed without errors. But, does not generate the requested result.

Logic errors occur when implement the algorithm for solving the problem incorrectly. But in logical errors it will executed the output without an error. But the thing is, it does not giving the expected output. When concern about the syntax errors we can identify that the program will not compile until all syntax errors are correct. In semantic errors it indicate that the statement is out of scope when there is a semantic error. Syntax An error messages Semantic An error message
Table 3

Logical Program is compiled and executed without errors

If there is an syntax error it will indicate about this through an error message. If there is a semantic error, there also can see an error message. But not like syntax error or semantic error, According to the logical error the program is compiled and executed without errors. But, does not generate the requested result. Syntax Detected by the compiler Semantic May be detected by compiler, linker, run-time
Table 4

Logical May be detected at runtime

Normally Syntax errors are detected by the compiler. Semantic errors may be detected by compiler, linker or semantic errors can detect at run-time. When concern about the Logic errors, we can identify logical errors may be detected at run-time. But sometimes these errors are not detected at all Syntax WHIL(x<=10) IF(avg>=70)THE total=m1+m2+m3 Semantic IF(avg>70)THEN READ PASS ELSE DISPLAY FAIL END IF Total=m1+m2+m3 Avg=(m1*m2*m3)/3; Logical IF(avg>70)THEN grade= fail ELSE grade= pass END IF

Logi cal error

Synt ax error

Semantic error
Table 5

You might also like