How to add two numbers in .Net

Step 1.

Create a New Window Application Form in Microsoft Visual Studio.

create window

Step 2.

Design your Window Application Form like below form.

add form

Step 3.

Now double click on Submit Button and write below coding.

    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;

    namespace WindowsFormsApplication1
    public partial class Form1 : Form
        public Form1()

        //submit button coding
        private void button1_Click(object sender, EventArgs e)
            int a, b, c;
            a = Convert.ToInt32(textBox1.Text);
            b = Convert.ToInt32(textBox2.Text);
            c = a + b;
            textBox3.Text = c.ToString();


add output

Post Your Comment