Question: what is the difference between syntax error and semantic error?
Answer: Syntax errors occur during the parsing of input code, and are caused by grammatically incorrect statements. ... Semantic errors occur during the execution of the code, after it has been parsed as grammatically correct. These have to do not with how statements are constructed, but with what they mean.