________________ is detected when we have not followed the rules of the particular programming language while writing a program.
________________ is detected when we have not followed the rules of the particular programming language while writing a program.
Solution
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.
Related questions:
2025: 16 May Shift 1
2025: 20 May Shift 1