I have been doing a bit of experimenting, and have discovered that an exception is being thrown, when an integer divide by zero occurs.
#include
The result is undefined, you could use __try / __except block to catch the error (structured exception handling). However, why not simply check for the error before your division?