Logic Error

esse quam videri
Revision as of 17:47, 8 August 2019 by Pedro (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


A logic error is a type of error that has to do with a user's code not performing as expected. Logic errors may be difficult to spot as well because they are still valid code and will not cause the program to crash. Logic errors are also known as "bugs" in code.


This is important as recognizing logic errors early can speed up the time it takes to finish a program.


float Average(float number1, float number2)
    return number1 + number2 / 2; // This is a logic error because number1 + number2 is not in parenthesis. This equation is number 1 + (number2 / 2) instead of (number1 + number2) / 2.

See also

External Links