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).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a logic error?

A

The program runs but does not give the expected output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly