Question 1 Report
What type of errors occurs when the program is asked to implement an impossible task such as dividing a number by zero?
Programming errors are generally grouped into three categories: syntax errors, runtime errors, and logical errors. Each occurs at a different stage of running a program.
Dividing by zero is mathematically undefined, so when a running program attempts it, the system halts that operation and reports the failure while the program is in progress. This mid-execution failure on an impossible task is the defining feature of a runtime error.
Exam tip: if an error happens only when the program is actually running and involves an operation that cannot be completed (like division by zero or a missing file), classify it as a runtime error rather than a syntax or logical error.
Everything you need to excel in your exams