Bugs & Debugging
Error in the program is called Bugs. The process of finding and removing error is called Debugging.
Types of Error
There are three types of errors that may occur while developing or writing Program. These errors are:
- Syntax Errors
- Logical Errors
- Runtime Errors
Syntax Errors
The set of rules of a programming language are writing statements of the computer program is known as syntax of the language. The program statements are written strictly according to these rules.Syntax error occur when syntax of a programming language are not followed in writing the source code. The compiler detects these errors at compiling time of source code. the compiler reports aproper error message about the error.
The compiler does not compile a program that contain syntax error. The syntax errors are easy to detect and remove.
* Missing semicolon (;) at the end of statement.
* Missing any of the delimiters i.e { }.
* Incorrect spelling of any keyword.
* Using variable without declaration etc.
Logical Errors
The errors in the logic of the program are called logical error. The compiler cannot detect logical errors. A program with logical errors is compiles and run successfully but it does not give correct result.
* The sequence of instructions used in aprogram may be incorrect.
* The mathematical formula used in program instructions may be incorrect etc.
The logical error are difficult to detect. Logical errors can only be detected by examining all the units of the program one by one. It is a very time consuming and lengthy process.
Runtime Errors
The errors that occur during execution of the program are called runtime error or execution errors. These types of errors may occur due to the following reasons.
* When the program attempts to perform an illegal operation such as dividing a number by zero.
* If input data given to the program is not in a correct format or input data file is does not found in the specified path.
* If hardware problem occur such as hard disk error or disk full or printer error etc.
When a runtime error occurs, the computer stops the execution of program and displays an error message.
No comments:
Post a Comment
Thanks For Visiting Here...!! I will Reply you as soon as possible.