Can't catch the division by 0 exception | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can't catch the division by 0 exception

i want this program to catch the division by 0 exception, however, this does not happen. Program just... crashes and doesent even execute the catch block. Why does this happen and how can i make it work? https://code.sololearn.com/cv8Cox07cDVr/?ref=app

5th Sep 2018, 7:55 PM
Data
Data - avatar
2 Answers
+ 2
Division by 0 is not an exception in C++. You'll have to check yourself whether you are dividing by 0 and then throw manually.
5th Sep 2018, 8:04 PM
Dennis
Dennis - avatar
0
Dennis oh, i wanted to make a program that relied on it being a standart exception
5th Sep 2018, 8:07 PM
Data
Data - avatar