Exam-style question
Try this first
A programmer writes a program to calculate the average of three numbers. The program compiles and runs without crashing, but the result is always slightly off. What type of error is most likely present?.
- A.Syntax error
- B.Runtime error
- C.Logic error
- D.Hardware error
Answer and explanation
Concise answer
Logic error
Why this is correct
Since the program runs but produces incorrect output, it indicates a flaw in the algorithm's logic, not a syntax or runtime issue.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
