fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public void checkException ( )
  6. {
  7. int a = 10, b = 0;
  8. Console.WriteLine ( "{0}", a/b );
  9. }
  10. public static void Main()
  11. {
  12. // your code goes here
  13. Test test = new Test();
  14. try
  15. {
  16. test.checkException ( );
  17. }
  18. catch (Exception e)
  19. {
  20. Console.WriteLine ( "Hello Check the Division {0}", e );
  21. }
  22. }
  23.  
  24. }
Success #stdin #stdout 0.03s 25220KB
stdin
Standard input is empty
stdout
Hello Check the Division  System.DivideByZeroException: Attempted to divide by zero.
  at Test.checkException () [0x00005] in <baefa80af2c34eea9fb8bb9f7a20b4a6>:0 
  at Test.Main () [0x00006] in <baefa80af2c34eea9fb8bb9f7a20b4a6>:0