You are on page 1of 1

Difference between syntax and logic errors

Syntax can be said to refer to the rules of a programming language. Computers are inflexible machines that understand what you type only if you type it in the exact form that the computer expects. The expected form is called the syntax. Each program defines its own syntactical rules that control which words the computer understands, which combinations of words are meaningful, and what punctuation is necessary. A logic error occurs when a step in the program logic (sequence) is incorrect eg. an average program will produce a wrong answer if the sum of the numbers to be divided by a number other the total count of the numbers.

You might also like