Guest User

Untitled

a guest
Feb 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. double varrr = Divide(10, 0);
  6. }
  7.  
  8. static double Divide(double a, double b)
  9. {
  10. double c = 0;
  11. try
  12. {
  13. c = a / b;
  14. return c;
  15. }
  16. catch (DivideByZeroException)
  17. {
  18. Console.WriteLine("Division by zero not allowed");
  19. return 0;
  20. }
  21. }
  22.  
  23. }
Add Comment
Please, Sign In to add comment