9
QuizMultiple Choice

Use Data Structures — Cumulative exam

Question 9 • Introduction to Information Technology - EL3701

While running a program, Sasha enters a negative number when a positive value was expected. Which type of error is likely to occur?

Answer
A
syntax
B
run-time
C
logic
D
interpreter

Explanation

The program can be written with correct syntax, but the negative number is invalid for the situation and may cause a problem while the program is executing. An error that occurs during execution is a run-time error, so the correct choice is run-time. A logic error is a flaw in the program’s instructions, rather than an invalid value entered while it runs.

AI-written and checked against the verified answer.

Previous
Next