Professional Documents
Culture Documents
Disusun Oleh :
202208 Baharuddin
namespace latihan1
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void Button1Click(object sender, EventArgs e)
{
//penjumlahan
int text;
int box;
int jumlah;
text = int.Parse(textBox1.Text);
box = int.Parse(textBox2.Text);
textBox3.Text = Convert.ToString(jumlah=text+box);
}
void Button2Click(object sender, EventArgs e)
{
//pengurangan
int text;
int box;
int kurang;
text = int.Parse(textBox1.Text);
box = int.Parse(textBox2.Text);
textBox3.Text = Convert.ToString(kurang = text - box);
}
void Button3Click(object sender, EventArgs e)
{
//perkalian
int text;
int box;
int kali;
text = int.Parse(textBox1.Text);
box = int.Parse(textBox2.Text);
textBox3.Text = Convert.ToString(kali = text * box);
}
void Button4Click(object sender, EventArgs e)
{
//pembagian
int text;
int box;
int bagi;
text = int.Parse(textBox1.Text);
box = int.Parse(textBox2.Text);
textBox3.Text = Convert.ToString(bagi = text / box);
}
}
}
HASIL