Differentiate between syntax err9r and logical error give the suitable example in c++
Answers
Answered by
1
Answer:
Every programmer knows that debugging is a time-consuming nightmare, so it makes a good candidate for programmers to learn how to deal with. There are generally two types of errors: syntax errors and logic errors.
Syntax errors occur when a program does not conform to the grammar of a programming language, and the compiler cannot compile the source file. Logic errors occur when a program does not do what the programmer expects it to do.
Syntax errors are usually easy to fix because the compiler will tell you where the error occurs and you simply fix the syntax error. For example you may miss a semicolon or a curly bracket where it’s supposed to be. Simply locate those errors and fix them.
Similar questions