Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Código para calculadora simples em C#.
- private void btnCalcular_Click(object sender, EventArgs e)
- {
- txtTabuada.Text = "";
- if (txtTabuadaDesejada.Text == "")
- {
- MessageBox.Show("Você precisa digitar um número para calcular a tabuada.", "Informação",
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- else
- {
- double numero, resultado;
- numero = double.Parse(txtTabuadaDesejada.Text);
- for (int i = 0; i <= 10; i++)
- {
- resultado = numero * i;
- txtTabuada.Text += numero + "x" + i + "=" + resultado + "\r\n";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement