What is an error?
An error is a message that tells about a mistake or causes an unexpected or incorrect result. The sudden occurrence of unexpected or incorrect results is called an error. An error describes all parts of it like if you have any error in your program error tells about his location in the program and then we can solve it easily. Computers can face multiple errors and we must have to solve it first and then we may counting our program. The error can hold and held the program and computer.
There are three types of error are as follow:
- Syntax error
- Logical error
- Run- time error
In computer science, a syntax error is an error which is not follow the rules of programming. We must have to write the program in that way so that computer can understand it easily. The syntax of a sequence of alphabets, numbers and special characters that is intended to be written in a particular programming language. For compiled languages, syntax errors are detected by compiler. A program will not compile until all syntax errors are remove. Let me understand you with an example Like if we want to declare a variable then we have to write a=5. Instead of that we right 5=a then it is syntax error because 5 is an integer number and it cannot store the any value.
In computer programming, actually a logic error is a bug in a program that occur when logic of program is wrong but this error doesn’t destroy the whole program because logical error is not detected by compiler. But it’s behave like abnormally logical and give incorrect error. A logic error produces unexpected result and undesired output or other behavior, although it may not immediately be recognized as such. Let understand with an example if we want to add two values then we write sum=3+2. Instead of that if we write sum=3-2 then it is not syntax error because the we follow the all rules of programming but this is logical error because in our mind we write there plus (+) but actually there is subtraction (-). So that answer according to our program is correct but due to logical error wrong considered.
You can also read this article :
What are Ram and Rom
In computer programming, a run-time error is a programming error that occurs while the program is running. Unexpected result or incorrect result of a program during the execution of program is Run-time error. This error doesn’t destroy the whole program because Run-time error is not detected by Compiler also. This error may have be much time for resolve. It is much time taking. There are many different types of runtime errors. Let understand with an example if we want to access a file during the execution of program and file does not exist in the storage medium then we may face the a error and that is run-time error.
Follow Us Social media :