Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

What is the difference between logic errors and syntax errors?

+4 votes
asked Aug 25, 2016 in CSC 211 (F16) by Isabel Matthei (100 points)

2 Answers

+2 votes
A logic error means that you programmed the computer to do something that you don't want it to, like if you try to tell the computer to draw a circle but you accidentally tell it to draw a square. A syntax error means that you typed something incorrectly, like you're missing a semicolon or you misspelled a word.
answered Aug 25, 2016 by Maegan Patterson (100 points)
+2 votes
Logic error is like the program runs perfectly but it shows a wrong answer. For example : input = 1 + 1; output = 3.

A syntax error is typo, missing brackets, missing semicolons, etc. . The program wouldn't run if you have a syntax error(s).
answered Aug 25, 2016 by Minh Ta (100 points)