Programming errors
Some
disabilities (errors) are occurring in program during coding. In computer
language these errors are called bugs
and the process of finding and removing these bugs is called debugging.
Types:
There are three types of programming errors:
·
Syntax error.
·
Runtime error.
·
Logical error.
Syntax error:
Syntax error occurs when the program violates one or more
grammatical rules of a programming language.
*The compiler detects these
errors as it attempts to translate the program.
Example:
·
Missing of
statement terminator.
·
Undeclared
variable are used.
Runtime error:
A runtime error occur when the program directs the
perform illegal operation or task.
*Error detect at execution
time.
Example:
·
Dividing a number
by zero.
Logical error:
Logical error occurs when a program follows a wrong or
faulty logic or algorithm.
*Compiler does not detect
logical error. It is detected by see the output or testing of the program.
Example:
·
If you put –
instead of + so the output goes wrong.
Comments
Post a Comment