What is the difference between logical error and syntax error?


4 Answers

yuan hui Profile
yuan hui answered
A syntax error means a language was used incorrectly: If you forget to put certain symbols in source code, the machine will not be able to read it. A logic error is though the language was used correctly, there was a misunderstanding: If you want a, where b=c+a and you give a = b-a instead of a = b-c, then you will get the wrong answer, but have used the correct language.
Steve Fort Profile
Steve Fort answered

Syntax error also known as compile time error. It occurs when programmer is not following the rules of programming languages. These error are easily detected by the compiler or assembler with the line number and cause or error.

Logical error also known as semantic error. If your syntax is correct, then also logical error will occur. Logical error happens when we tell something to do and the intend is different which produce wrong output. These errors are difficult to detect because these errors are not identified by compiler or assembler.

Rajat Dhande Profile
Rajat Dhande answered

Syntax Error
1-These involves validation of syntax of language.
2-compiler prints diagnostic message.
Logical Error
1-logical error are caused by an incorrect algorithm or by a statement mistyped in such a way
that it doesn‘t violet syntax of language.
2-difficult to find.

for more info on this visit

careerz pk Profile
careerz pk answered

You find a job ? No need to worry about that we are here for you. Your career development website where you get your dream job. Just one click on website and search for new dream job. Jobs are available in site where you can search for career jobs which you want.

Answer Question