Wa0008.
Wa0008.
DEFINITION EXAMPLES
Syntax errors occur when the code Missing semicolons, unclosed
violates the grammar rules of the parentheses, or misspelled keywords
programming language. They are like are common syntax errors.
grammatical mistakes in human
language
WHAT ARE RUNTIME ERRORS?
Use print statements or Consider handling edge cases and Utilize error handling mechanisms
debuggers to track program unexpected inputs to prevent like try-catch blocks to gracefully
flow and identify the source runtime errors. handle runtime errors.
of the error
EXAMPLES OF COMMON
RUNTIME ERRORS IN REAL-
WORLD APPLICATIONS
• Division by zero: Occurs when a program attempts to
divide a number by zero, which is mathematically
undefined.
• Out-of-range or type mismatch errors: Happen when a
program tries to access an element outside the bounds
of an array or tries to use a value of the wrong type.