NIMCET 2018 — computer PYQ
NIMCET | computer | 2018What type of errors are not detected by assembler?
Choose the correct answer:
- A.
Syntax error
- B.
Run time error
- C.
Logical Error
(Correct Answer) - D.
All of these
Logical Error
Explanation
The correct answer Logical Error.
A logic error (or logical error) is a mistake in a program's source code that results in incorrect or unexpected behavior.
It is a type of runtime error that may simply produce the wrong output or may cause a program to crash while running.
Logic errors cause a program to work incorrectly.
For example, in PHP, when "if (i=1) {…}" is incorrectly entered instead of "if (i==1) {….}," the former means "becomes" while the latter means "is equal to."
The incorrect if statement would always return TRUE as assigning 1 to the variable i. <br>In the correct version, though, the statement only returns TRUE when the value of variablei is equal to 1.
The syntax in the incorrect case is perfectly correct as per the language.
The code would compile successfully without producing any syntax errors.
During runtime of the code, the resultant output may be wrong, thus showing that a certain logic error has occurred.
Logic errors tend to be hidden in the source code and can typically be harder to determine and debug, unlike syntax errors that are recognized at compile time.

