Introduction to Programming – Errors
- YASH KUMAR SONI
- May 15, 2022
- 1 min read
Updated: Dec 12, 2022
Programming errors are also known as bugs or faults, and the process of removing these bugs is known as debugging. These errors are detected either during the time of compilation or execution. Thus, the errors must be removed from the program for the successful execution of the program.

There are basically three types of error:
Compilation error or Syntax error
Runtime error or exception
Logical error
Compilation error
Compilation errors are the most common error occurred due to typing mistakes or if you don't follow the proper syntax of the specific programming language. These errors are thrown by the compilers and will prevent your program from running. These errors are most common among beginners. It is also called a Compile time error or Syntax error. These errors are easy to debug.
Example: Typing int as Int
Runtime error
Run Time errors are generated when the program is running and leads to abnormal behavior or termination of the program. The general cause of Run time errors is because your program is trying to perform an operation that is impossible to carry out.
Example: Dividing any number by zero, Accessing any file that doesn't exist, etc are common examples of such errors.
Logical error
The logical error will cause your program to perform undesired operations that you didn't intend your program to perform. These errors occur generally due to improper logic used in the program. These types of errors are difficult to debug.
Example: Multiplying an uninitialized integer value with some other value will result in undesired output.
Comentários