What do we call it when a program does something that was not intended?

Prepare for the OCR GCSE Computer Science Paper 2 exam. Practice with diverse questions, flashcards, and detailed explanations. Boost your confidence and ace your test!

When a program does something that was not intended, it is referred to as a logic error. This type of error occurs when the program runs without crashing but produces incorrect or unexpected results due to flawed reasoning or incorrect implementation of the logic. Logic errors are often difficult to identify because the program may not display any failure messages and can appear to run smoothly while still delivering inaccurate outcomes.

In contrast, a syntax error involves mistakes in the code that violate the grammar rules of the programming language, leading to failure in compiling or interpreting the program. A runtime error occurs during the execution of the program, resulting in crashes or exceptions, which is distinct from producing unintended results. Lastly, a semantic error refers more specifically to an issue where the syntax is correct, but the meaning or purpose of the elements is not what the programmer intended, which can overlap with logic errors but is generally more about misinterpretation of what the program should do rather than how it executes incorrectly.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy