Identify Syntax & Logic Errors in Testing Flashcards

All 4 cards in this deck

What is a syntax error?

An error that breaks the grammatical rules of the programming language, so the program cannot be run or translated.

What is a logic error?

An error that lets the program run but produces unexpected or incorrect output.

Give one example of a syntax error in code.

A misspelled keyword or a missing bracket/quotation mark, e.g. prnt("Hello").

Give one example of a logic error in code.

Using the wrong operator, e.g. total = a - b when the total should be a + b, or < where <= is needed.