What is a syntax error?
The syntax error has occurred in the code. For making a program we use keywords and to use keywords we have to follow some syntax rule for compiling and running successfully. If there is a lack of syntax then there is a syntax error. To resolve it the line number and the error type are shown by the compiler.