using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace ForgetCode { class Program { static void Main(string[] args) { int top = 0, bottom = 0, result = 0; try { result = top / bottom; } catch (System.DivideByZeroException ex) { Console.WriteLine("{0} Exception caught.", ex); } } } }
System.DivideByZeroException: Attempted to divide by zero.