Ace the 2025 OCR GCSE Computer Science Challenge – Code Your Way to Success!

Question: 1 / 400

What is the term for a mistake when a program behaves in an unintended way?

Syntax error

Logic error

A logic error refers to a mistake in a program that causes it to operate incorrectly or produce unexpected results, despite the program running without crashing. Unlike syntax errors, which are issues with the format or structure of the code that prevent it from compiling, logic errors occur when the code is syntactically correct but the algorithm or the flow of operations leads to incorrect outcomes.

For instance, a program designed to calculate the average of a series of numbers might sum the numbers correctly but forget to divide by the correct count, resulting in an incorrect average. This subtlety can be challenging to catch because the program does not communicate an error when it executes; it simply yields the wrong result.

In summary, logic errors stem from flaws in reasoning and design in the code, leading to unintentional behaviors during execution, making this term the appropriate choice in this context.

Get further explanation with Examzify DeepDiveBeta

Runtime error

Compilation error

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy