using System; public class Test{ public void checkException ( ) { int a = 10, b = 0; Console.WriteLine ( "{0}", a/b ); } public static void Main() { // your code goes here Test test = new Test(); try { test.checkException ( ); } catch (Exception e) { Console.WriteLine ( "Hello Check the Division {0}", e ); } } }
Standard input is empty
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
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!