Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Articulos.Cap04
- {
- public sealed class SinControlExcepciones
- {
- public static int Dividir (int a, int b)
- {
- // La expresión `a / b` es propensa a generar la
- // excepción de división entre cero:
- return a / b;
- }
- public static void Main()
- {
- int num1 = 7;
- int num2 = 0;
- Console.WriteLine ("\nLa división de {0} entre {1} es igual a {2}\n", num1, num2, Dividir(num1, num2));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement