Task 2 of 7 · 0 solved · 7 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

(Optional) 6.5 Exceptions — safe divide

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Fill in safeDivide so that it returns a / b, but returns 0 instead of crashing when b is zero.

The program prints 5 and then 0.

Your solution