示例#1
0
        private void lblSuma_Click(object sender, EventArgs e)
        {
            double      n1 = Convert.ToDouble(txtn1.Text);
            double      n2 = Convert.ToDouble(txtn2.Text);
            Operaciones op = new Operaciones();

            lblResultado.Text = (op.suma(n1, n2)).ToString();
        }
示例#2
0
        public double seleccion(int seleccion)
        {
            double num1, num2;

            Console.Write("numero 1:");
            num1 = double.Parse(Console.ReadLine());
            Console.Write("numero 2:");
            num2 = double.Parse(Console.ReadLine());
            switch (seleccion)
            {
            case 1:
                return(operacion.suma(num1, num2));

            default:
                return(0);
            }
        }