Here are the choices and the reasons some are incorrect:
(A) Error in syntax
When your code deviates from the conventions of the programming language you are using, you have a syntax error. A syntax error would be, for instance, failing to include a semicolon at the end of a statement. The existence or lack of a file in memory has no bearing on a syntax error.
(B) Error at runtime
The most likely correct answer is this one. Unlike syntax errors, which are discovered before the program even starts, runtime errors happen while the program is running. A runtime error would result from the program attempting to access data that is not there due to a file not being in memory.
(C) Error in logic
Any mistake in the program’s logic that results in incorrect output is known as a logical error. For instance, a bug in a square footage calculation program could result in the incorrect answer. A logical error simply indicates that the program might use the file incorrectly; it would not necessarily stop it from finding the file.
(D) Error: File missing
Although it is not a common technical term, this is a more descriptive term for the kind of runtime error that would happen if a file was not in memory.
Here are the choices and the reasons some are incorrect:
(A) Error in syntax
When your code deviates from the conventions of the programming language you are using, you have a syntax error. A syntax error would be, for instance, failing to include a semicolon at the end of a statement. The existence or lack of a file in memory has no bearing on a syntax error.
(B) Error at runtime
The most likely correct answer is this one. Unlike syntax errors, which are discovered before the program even starts, runtime errors happen while the program is running. A runtime error would result from the program attempting to access data that is not there due to a file not being in memory.
(C) Error in logic
Any mistake in the program’s logic that results in incorrect output is known as a logical error. For instance, a bug in a square footage calculation program could result in the incorrect answer. A logical error simply indicates that the program might use the file incorrectly; it would not necessarily stop it from finding the file.
(D) Error: File missing
Although it is not a common technical term, this is a more descriptive term for the kind of runtime error that would happen if a file was not in memory.