sábado, 18 de octubre de 2014

División de dos valores


private void button1_Click(object sender, EventArgs e)
        {
            int a, b, c;
            string r;
            a = Convert.ToInt32(textBox1.Text);
            b = Convert.ToInt32(textBox2.Text);
            c = a / b;
            r = (string.Format("{0:F2}", c));
            textBox3.Text = r;

        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
            textBox2.Text = "";
            textBox3.Text = "";

        }
    }
}

No hay comentarios:

Publicar un comentario