Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Articulos.Cap04.Excepciones.Parte5
- {
- public sealed class UsoDivideByZeroException
- {
- public static void Main()
- {
- int dividendo = 13;
- int divisor = 0;
- try
- {
- Console.WriteLine ("{0}/{1}", (dividendo/divisor));
- }
- catch (DivideByZeroException)
- {
- Console.WriteLine ("Error: Intento de división entre cero.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement