Skip to main contentSkip to solution

________________ is 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 while translating the code, and the program will not run until it is fixed.


Semantic Error and Logical Error: the code follows the language rules but gives wrong or unintended results, for example using + instead of - in a formula.

Run-time Error: occurs while the program is running, for example division by zero, even though the syntax was correct.

Keyboard Shortcuts

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