COMPUTER PROGRAMMING FUNDAMENTALS
PROGRAMMING LANGUAGES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
An error in a program that causes it to produce incorrect ouputs but not a crash.
|
|
An error in a program that causes it to crash.
|
|
An error in the program caused by mis-spelt instructions.
|
|
An error in a program caused by hardware failure.
|
Detailed explanation-1: -Detailed Solution. 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.
Detailed explanation-2: -Q. Which statement best describes logic errors? An error in a program that causes it to produce incorrect ouputs but not a crash.
Detailed explanation-3: -Logic errors occur when there is a fault in the logic or structure of the problem. Logic errors do not usually cause a program to crash. However, logic errors can cause a program to produce unexpected results.
Detailed explanation-4: -Logical/Semantic Error If your program is syntax free it will compile successfully. But, if the logic is incorrect it is not necessary that you get the desired output. Therefore, such errors are logical or semantic errors.
Detailed explanation-5: -Runtime errors However, the program may exit unexpectedly during execution if it encounters a runtime error – a problem which was not detected when the program was parsed, but is only revealed when a particular line is executed. When a program comes to a halt because of a runtime error, we say that it has crashed.