English, asked by Bhavyasharma6571, 9 months ago

What is error and types of error

Answers

Answered by Anonymous
5

An error is an action which is inaccurate or incorrect. In some usages, an error is synonymous with a mistake. In statistics, "error" refers to the difference between the value which has been computed and the correct value.

What are the type of Errors

Programming errors are mainly in three categories; Syntax Errors, Run time Errors and Logic Errors.

Syntax Errors

Syntax Errors, also known as Compilation errors are the most common type of errors. Most Syntax errors are caused by mistakes that you make when writing code. If you are using the coding environment like Visual Studio, it is able to detect them as soon as you write them, also you can fix them easily as soon as they occur. When you compile your application in the development environment, the compiler would point out where the problem is so you can fix it instantly.

Ex: When you forgot to type a semicolon after the statement, the compiler shows the syntax error and it would point out where the problem occurred.

Run-time Errors

Run-time errors are those that appear only after you compile and run your code. It will occur when your program attempts an operation that is impossible to carry out. You can fix most run-time errors by rewriting the faulty code, and then recompiling and running it.

Ex: A program error may result from an attempt to divide by zero.

When you compile this program, compiler won't show any Syntax Error. But when you run this code, the compiler show "Attempted to divide by zero".

Exception Handling

Programming errors are mainly in three categories;

Runtime Errors occurs during the execution of a program that disrupts the normal flow of instructions Exception handling features help you deal with any unexpected or exceptional situations that occur when a program is running.

Logic Errors

Your code may compile and run without any Syntax Errors or Run-time Errors, but the output of an operation may produce unwanted or unexpected results in response to user actions. These types of errors are called Logic Errors. That means, Logic errors are those that appear once the application is in use. These are generally the hardest type to fix, since it is not always clear where they originate. Also the development environment does not see anything wrong in the document and therefore cannot point out a problem

Hope it helps you! plz mark it as brainliest!

Similar questions