Syntax and logic errors Flashcards
1
Q
What is a syntax error?
A
The rules of the language have been broken. The program will not run (in compiled languages).
2
Q
What are the common causes of syntax errors?
A
Variables are not declared or initialized before use. Incompatibility of variable types (e.g.
3
Q
What is a logic error?
A
The program runs but does not give the expected output.
4
Q
What are the common causes of logic errors?
A
Conditions and arithmetic operations are wrong. The sequence of commands is wrong. Division by zero. Exceptions (e.g.