Skip to main contentSkip to solution

________ errors are detected when we have not followed the rules of the particular programming language while writing a program.

Solution

✅ Correct Option: 2

A syntax error occurs when the program breaks the grammar rules of the programming language, such as a missing colon, an unmatched bracket or a misspelt keyword. The compiler or interpreter detects it before the program runs and refuses to execute the code until it is fixed.


Logical error: the program runs without complaint but gives wrong output because the logic is flawed, and the translator does not report it.

Runtime error: the program starts but crashes during execution, for example on division by zero.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question