static void Main(string[] args) { MathOps m = new MathOps(); Console.WriteLine($"Add = {m.Add(30,40)}"); Console.WriteLine($"Mult = {m.Mult(30, 40)}"); Console.WriteLine($"Add = {m.AddSquare(30, 40)}"); Console.WriteLine($"Mult = {m.MultSquare(30, 40)}"); string str = "James Bond"; Console.WriteLine($"Length of {str} = {str.Length}"); Console.WriteLine($"Reverse of {str} = {str.ExtReverse()}"); Console.ReadLine(); }
public static int MultSquare(this MathOps m, int x, int y) { return((x * x) * (y * y)); }
public static int AddSquare(this MathOps m, int x, int y) { return((x * x) + (y * y)); }