public int Divide(MyNumbers obj) { int result = 0; try { result = obj.Number1 / obj.Number2; } catch (System.DivideByZeroException dbze) { throw new DivideByZeroException(dbze.Message); } catch (Exception ex) { throw new Exception(ex.Message); } return(result); }
public int Subtract(MyNumbers obj) { return(obj.Number1 - obj.Number2); }
public int Add(MyNumbers obj) { return(obj.Number1 + obj.Number2); }