QUESTION IMAGE
Question
which of the following is an example of a runtime error?
i. karel crashing into a wall
ii. leaving a colon off the end of a function definition
iii. using the wrong syntax in an if/else statement
iv. not closing all open parenthesis
i
i and iii
ii and iv
i - iv, all
Brief Explanations
Runtime errors occur while a program is executing, not during compilation/parsing.
- I: Karel crashing into a wall happens when the program runs, so it is a runtime error.
- II, III, IV: Missing colons, wrong syntax, unclosed parentheses are syntax errors caught before the program runs, not runtime errors.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
I