v blackcaps

v blackcaps

  • NA
  • 27
  • 3.4k

adding two numbers and how to solve this problem?

Jan 14 2020 5:47 PM
Sir,
 
I try to write a code adding two numbers using text box it show sum error plz helop me.
 
int num1;
            int num2;
            int total;
           
        }

        private void button1_Click(object sender, EventArgs e)
        {
            // this program calculate 2 numbers and display the result in the message box
            int num1 = Convert.ToInt32(textBox1.Text);
            int num2 = Convert.ToInt32(textBox2.Text);
            int total = num1 + num2;
           
           
                MessageBox.Show("results"+total.ToString());
   
            }
        }
    }
 
wds
 
blackcaps
 
 
 
 
 
 

Answers (2)