How many types of error are there in programming?

Error is just a message that shows which type of mistakes or faults occur in our code. Error befall because of some fault in code.

There are some kinds of type of error below:

1.       Syntax error: This error is caused due to incorrect syntax in the program.

There is a syntax mistake of the colon(:) in for loop.


2.       Semantic error: Error due to invalid use of program statement.

Here, an error arises due to a mistake in variable declaration. The compiler will show ‘iny is not a datatype’ because the user is written ‘iny’ instead of ‘int(datatype)’.


3.       Logical error: In this error, the program can be compiled and executed without error, but does not show a requested result.



4.       Compile time error: generally, an error is detected by the compiler which is generated and implies the type of error. First of all, if the compiler executed a code then it will be indicated an error. Syntax error and semantic error are detected by the compiler.


5.       Runtime error runtime error is not identified by the compiler. A runtime error is a programming error that is detected when code is executed. The logical error is an example of runtime error


Post a Comment