Coupon Accepted Successfully!


Types of Errors

There are three basic types of programming errors. That is, your objective is to write programs that are totally free of program errors. Program errors are also called as bugs. The three types of errors are
  • Compile time error
  • Runtime error
  • Logical error

Compile time error

  • It is referred as a operation performed by a compiler, the programming language where their requirements are met by source code for it to be successfully compiled, or properties of the program that can be reasoned about at compile time.
  • It occurs before the link time.
  • They are of two types. They are
    • Syntax errors: It occurs when rules of a programming language are misused. 
      • Example: a-b-c*+2; in this statement operators are misused. 
    • Semantics errors: It occurs when statements are not meaningful. 
      • Example: aa@b$c%5; in this statement the special characters are used which does not perform any operations at any sequence.
Note: The process of correcting a bug is called debugging.

Run time error

  • This type of error occurs during run time. i.e. during execution of a program
  • This errors can stop a process abnormally
  • It is not easy to identify the errors of this kind
  • C++ usually takes care of such errors by terminating the program.
  • A program that crashes whenever it detects an error condition is not desirable.

Logical error

  • Errors due to the logic used when program is generated and therefore fails to solve the problem
  • No error message will be displayed when a logic error occurs.
  • The user has to check the logic and produce the correct solution.

Test Your Skills Now!
Take a Quiz now
Reviewer Name