public int subtracting(int x) { mathing math2 = new mathing(); int subtract = x - 3; Console.WriteLine("Your number minuse 3 is " + subtract); return(subtract); }
public double dividing(int x) { mathing math3 = new mathing(); double divide = x / 2; Console.WriteLine("Your number divided by 2 is " + divide); return(divide); }
//public int userInput() //{ // Console.WriteLine("Enter a number!"); // int userNumber = Convert.ToInt32(Console.ReadLine()); // return userNumber; //} public int adding(int x) { mathing math1 = new mathing(); int add = x + 10; Console.WriteLine("Your number plue 10 is " + add); return(add); }
public static void Main(string[] args) { Console.WriteLine("Enter a number"); int userNumber = Convert.ToInt32(Console.ReadLine()); mathing math1 = new mathing(); mathing math2 = new mathing(); mathing math3 = new mathing(); math1.adding(x: userNumber); math2.subtracting(x: userNumber); math3.dividing(x: userNumber); Console.ReadLine(); }