01.
using
System;
02.
using
System.Collections.Generic;
03.
using
System.ComponentModel;
04.
using
System.Data;
05.
using
System.Drawing;
06.
using
System.Linq;
07.
using
System.Text;
08.
using
System.Threading.Tasks;
09.
using
System.Windows.Forms;
10.
11.
namespace
Training1
12.
{
13.
public
partial
class
Form1 : Form
14.
{
15.
16.
public
Form1()
17.
{
18.
InitializeComponent();
19.
20.
}
21.
22.
private
void
BTN1_Click(
object
sender, EventArgs e)
23.
{
24.
int
n1 = Convert.ToInt32(txtnum1.Text);
25.
int
n2 = Convert.ToInt32(txtnum2.Text);
26.
27.
int
sum = 0 ;
28.
sum = n1 + n2;
29.
30.
31.
txttotal.Text = (sum.ToString());
32.
}
33.
34.
private
void
BTN2_Click(
object
sender, EventArgs e)
35.
{
36.
int
n1 = Convert.ToInt32(txtnum1.Text);
37.
int
n2 = Convert.ToInt32(txtnum2.Text);
38.
39.
int
sum = 0;
40.
sum = n1 - n2;
41.
42.
43.
txttotal.Text = (sum.ToString());
44.
}
45.
}
46.
}