Which of the following error can a compiler check?
2021
Which of the following error can a compiler check?
Answer: A. Syntax Error — The compiler can detect syntax errors because they break the grammar rules of the programming language before the program is run. It cannot detect logical…
- A.
Syntax Error
- B.
Logical Error
- C.
Both Logical Error and Syntax Error
- D.
None of the above
Attempted by 541 students.
Show answer & explanation
Correct answer: A
The compiler can detect syntax errors because they break the grammar rules of the programming language before the program is run. It cannot detect logical errors automatically, because logical errors depend on the meaning of the program and usually appear only when you run it and see wrong output.
Loading lesson…