Yapacağımız en basit uygulama bile olsa işe tasarım bölümünden başlamalıyız.Böylece daha düzenli bir çalışma yaparız ve işler karışmaz.
PROGRAMIN TASARIMI
TOPLA BUTONU KODLARI
ÇIKAR BUTONU KODLARI
ÇARP BUTONU KODLARI
BÖL BUTONU KODLARI
TÜM BUTON KODLARI
protected void Button1_Click(object sender, EventArgs e)
{
int sayi1, sayi2;
sayi1 = Convert.ToInt32(TextBox1.Text);
sayi2 = Convert.ToInt32(TextBox2.Text);
int sonuc = sayi1 + sayi2;
Label1.Text = "Toplam= " + sonuc;
}
protected void Button2_Click(object sender, EventArgs e)
{
int sayi1, sayi2;
sayi1 = Convert.ToInt32(TextBox1.Text);
sayi2 = Convert.ToInt32(TextBox2.Text);
int sonuc = sayi1 - sayi2;
Label1.Text = "Çıkarma işlem sonucu= " + sonuc;
}
protected void Button3_Click(object sender, EventArgs e)
{
int sayi1, sayi2;
sayi1 = Convert.ToInt32(TextBox1.Text);
sayi2 = Convert.ToInt32(TextBox2.Text);
int sonuc = sayi1 * sayi2;
Label1.Text = "Çarpım sonucu= " + sonuc;
}
protected void Button4_Click(object sender, EventArgs e)
{
int sayi1, sayi2;
sayi1 = Convert.ToInt32(TextBox1.Text);
sayi2 = Convert.ToInt32(TextBox2.Text);
int sonuc = sayi1 / sayi2;
Label1.Text = "Bölme sonucu= " + sonuc;
}
Yorumlar
Yorum Gönder