Run-time errors are detected by the computer and displayed during execution of a program.
They will halt the program when they occur but they often do not show up for some time.
A run-time error occurs when the user directs the computer to perform an illegal operation, for example:
- Dividing a number by zero
- Assigning a variable to the wrong type of variable
- Using a variable in a program before assigning a value to it.
When a run-time error occurs, the computer stops executing the program, and will typically display a diagnostic message that indicates the type of run-time error that has occurred.