Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo
- {
- static void Main()
- {
- int my_int = 51;
- int my_other_int;
- try { my_other_int = double_value(my_int); }
- catch
- {
- System.Console.WriteLine("Value > 100 exception...\n");
- System.Environment.Exit(1);
- }
- }
- static int double_value(int foo)
- {
- foo = foo * 2;
- if (foo > 100) throw new System.Exception();
- return (foo);
- }
- }
Add Comment
Please, Sign In to add comment