What the different between syntax and logic error?

Recommended Answers

All 3 Replies

The difference between a syntax and a logic error is that, a syntax error occurs when you have violated a programming language's rules of writing an instruction/line of code. A logic error on the other hand, is an error caused by you misintepreting what has to be done, creating an incorrect algorithm and no syntax error occurs. Do you understand?

syntax error is an error in the source code of a program.
a logic error is a bug in a program that causes it to operate incorrectly

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.