Common Types of Errors in Programming Languages

Harsh Gupta - Tech Writer
Every programmer knows that rarely does a program run perfectly the first time. It doesn't matter how the design is carried out and no matter how much care is to be taken at the time of coding. No programmer can ever say that the program would be 100 percent. Therefore it is necessary to detect, isolate and correct all the errors which are likely to be present in the program.

Types of Errors:

There are a number of errors, some obvious and others not obvious that a less experienced C programmer could make. Complex coding and tricky coding might produce the errors.

These errors are like:

· Missing braces in the program.

· Improper comment characters.

· Undeclared variables.

· Forgetting to declare the function parameters.

· Missing semicolons at the end of the statement.

· Missing quotes in strings.

· Forgetting the precedence of operators. etc

These all types of errors can be classified under four types:

· SYNTAX ERROES.

· RUN TIME ERRORS.

· LOGICAL ERRORS.

· LATENT ERRORS.

We make the discussion on these errors step by step.

SYNTAX ERRORS:

Any violation of rules of the language result comes under syntax error. The compiler can detect and isolate these types of errors. When syntax errors present in the program then compilation fails.

RUN TIME ERRORS:

A program having this type of errors will run but produce erroneous result and there for the name run time error is given to such errors. Generally it is a difficult task to isolate run time errors.

LOGICAL ERRORS:

As the name implies, these errors are basically related to the program execution. These errors causes wrong results and these errors are primarily due to a poor understanding of a problem, in accurate translation of the algorithms in to the program and lake of hierarchy of operation.

For example:

If (x=y)

{

Printf("they are equal");

}

When x and y are equal then rarely x and y becomes equal and it will create a logical error.

LATENT ERRORS:

These types of errors are also known as 'hidden' errors and show up only when that particular set of data is used

For example:

Ratio=(x+y)/ (p-q)

That statement will generate the error if and only if when p and q are equal

This type of error can be detected only by using all possible combination of test data.

Published by Harsh Gupta - Tech Writer

I am a part time freelancer and writing is my hobby Some of my websites: http://www.GenericArticles.com http://www.JailBreakingiPhone.com  View profile

  • Any violation of rules of the language result comes under syntax error.
  • Generally it is a difficult task to isolate run time errors.
No programmer can ever say that the program would be 100 percent. Therefore it is necessary to detect, isolate and correct all the errors which are likely to be present in the program.

To comment, please sign in to your Yahoo! account, or sign up for a new account.