using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ExceptionHandling { class Program { /* * try and catch * الاخطاء */ static void Main(string[] args) { try { int a = 80, b = 0; double c = a / b; Console.WriteLine(c); } catch (DivideByZeroException ex) { Console.WriteLine(ex.ToString()); } catch { Console.WriteLine("from catch : noooooooo"); } finally { Console.WriteLine("from finally : noooooooo"); } Console.ReadKey(); } } }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more