Bug means:
2024
Bug means:
- A.
A logical error in a program
- B.
A difficult syntax error in a program
- C.
Both (A) and (B)
- D.
None of the above
Show answer & explanation
Correct answer: C
In software engineering, a “bug” (also called a fault or defect) is the general term for any error, flaw, or mistake in a program that causes it to behave incorrectly or produce an unintended result. A bug is not tied to a single cause — it can originate from a mistake in the program's logic, a violation of the language's syntax rules, a wrong assumption about data, or several other sources.
Applied here: a logical error (the program compiles and runs but reasons incorrectly, so it returns a wrong result) is one recognized category of bug, and a syntax error (the program breaks the language's grammar rules and typically fails to compile or run) is another recognized category. Because both of these are genuine instances of the general term, the option that combines the two matches the complete definition rather than a single narrow cause.
Why the other options fall short:
Restricting the definition to a logical error alone names only one possible cause of a bug — it leaves out defects that never get past compilation.
Restricting it to a (“difficult”) syntax error alone names only the other possible cause, and the added qualifier “difficult” narrows it further — it leaves out defects that compile fine but reason incorrectly.
Claiming none of the descriptions apply would only be true if neither a logic mistake nor a syntax violation counted as a program defect — which is not the case.
Cross-checking against the standard definition — a bug/fault/defect is any error that makes a program behave in an unintended way — confirms that both cause-types described above fit under that umbrella, so the option combining them is the complete, correct answer.