static void Main(string[] args) { methodMath doMath = new methodMath(); doMath.addMath(10, out int y); Console.WriteLine("Y is just printed: {0} ", y); Console.ReadLine(); }
static void Main(string[] args) { methodMath doMath = new methodMath(); Console.WriteLine("Enter a number to be divided by 2!"); int userInput = Convert.ToInt32(Console.ReadLine()); doMath.addMath(userInput, out int y); Console.WriteLine("Your number divided by 2: {0} ", y); Console.WriteLine("Here is a example of a output parameter"); doMath.twoNum(out int a, out int b); Console.WriteLine(a * b); int v1 = overloadMath.overMath(5); decimal v2 = overloadMath.overMath(5.8m); double v3 = overloadMath.overMath(100, 40); Console.WriteLine("Will add numbers together:" + v1); Console.WriteLine("Number is times together:" + v2); Console.WriteLine("Number is divided together:" + v3); Console.ReadLine(); }