COMPUTER SCIENCE AND ENGINEERING
ALGORITHMS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
____ errors in program statements that mean the outcome is unexpected, even though the program will run
|
|
____ errors in the algorithm that means the outcome is expected, even though the program will run
|
|
____ errors in the algorithm that means the outcome is unexpected, even though the program will run
|
|
____ errors in the algorithm that means the outcome returns nothing as the program will not run
|
Detailed explanation-1: -A logic error is classified as a type of runtime error that can result in a program producing an incorrect output. It can also cause the program to crash when running. Logic errors are not always easy to recognize immediately.
Detailed explanation-2: -A logic error is an error in the way a program works. The program can run but does not do what it is expected to do. Logic errors can be caused by the programmer: incorrectly using logical operators, eg expecting a program to stop when the value of a variable reaches 5, but using <5 instead of <=5.
Detailed explanation-3: -In computer programming, a logic error is a bug in a program that causes it to operate incorrectly, but not to terminate abnormally (or crash). A logic error produces unintended or undesired output or other behaviour, although it may not immediately be recognized as such.
Detailed explanation-4: -Logical errors are the most difficult to fix. They occur when the program runs without crashing, but produces an incorrect result. The error is caused by a mistake in the program’s logic. You won’t get an error message, because no syntax or runtime error has occurred.