Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using System;
  2.  
  3. namespace Articulos.Cap04.Excepciones.Parte5
  4. {
  5.     public sealed class UsoDivideByZeroException
  6.     {
  7.         public static void Main()
  8.         {
  9.             int dividendo = 13;
  10.             int divisor = 0;
  11.            
  12.             try
  13.             {
  14.                 Console.WriteLine ("{0}/{1}", (dividendo/divisor));
  15.             }
  16.             catch (DivideByZeroException)
  17.             {
  18.                 Console.WriteLine ("Error: Intento de divisiĆ³n entre cero.");
  19.             }
  20.         }
  21.     }
  22. }