Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please enter the input");
            string numbers = Console.ReadLine();

            //Create object and invoke the add method
            int result = new AddCalculator().Add(numbers);

            Console.WriteLine("The result is " + " " + result);
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            try
            {
                while (true)
                {
                    Console.WriteLine("Please enter the input");
                    string numbers = Console.ReadLine();

                    //Create object and invoke the add method
                    int result = new AddCalculator().Add(numbers);

                    Console.WriteLine("The result is " + " " + result);
                    Console.ReadLine();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.ReadLine();
            }
        }