What is error
What is error

What is 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 them first and then we may count our program. The error can hold and held the program and computer.

what is error
what is error

There are three types of error are as follow:

  • Syntax error
  • Logical error
  • Run-time error

Syntax Error

What is error in computer science, a syntax error is an error that does not follow the rules of programming? We must have to write the program in that way so that the computer can understand it easily. The syntax of a sequence of alphabets, numbers, and special characters that are intended to be written in a particular programming language. For compiled languages, syntax errors are detected by the compiler.

A program will not compile until all syntax errors are removed. 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 a syntax error because 5 is an integer number and it cannot store any value.

what is error
what is error

Logical Error

What is error in computer programming, actually, a logic error is a bug in a program that occurs when the logic of the program is wrong but this error doesn’t destroy the whole program because the logical error is not detected by the compiler? But it behaves abnormally logically and gives an incorrect error.

A logic error produces unexpected results 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 a syntax error because we follow all rules of programming but this is a 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: How to Get Free Traffic to Your Website! Increase Website Traffic)

      

Run-Time Error

what is error in computer programming? a run-time error is a programming error that occurs while the program is running. An unexpected result or the incorrect result of a program during the execution of the program is a Run-time error. This error doesn’t destroy the whole program because Run-time error is not detected by the Compiler also. This error may have been much time to resolve. It is much time taking. There are many different types of runtime errors. Let us understand with an example if we want to access a file during the execution of a program and a file does not exist in the storage medium then we may face the error and that is a run-time error.

Follow Us Social media :

 

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here