Guest User

Untitled

a guest
May 20th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. class Foo
  2. {
  3. static void Main()
  4. {
  5.  
  6. int my_int = 51;
  7. int my_other_int;
  8.  
  9. try { my_other_int = double_value(my_int); }
  10. catch
  11. {
  12. System.Console.WriteLine("Value > 100 exception...\n");
  13. System.Environment.Exit(1);
  14. }
  15. }
  16.  
  17. static int double_value(int foo)
  18. {
  19. foo = foo * 2;
  20. if (foo > 100) throw new System.Exception();
  21. return (foo);
  22. }
  23. }
Add Comment
Please, Sign In to add comment