Facebook Sayfamızı Beğenin

28 Şubat 2016 Pazar

C# İle Dört İşlem Mod Alma Üs Alma - Csharp

namespace WindowsFormsApplication4
{
 public partial class Form1 : Form
 {
 public Form1()
 {
 InitializeComponent();
 }
//Değişkenleri global tanımlıyoruz.
double sayi,sonuc,c;
//Çarpma İşlemi
 private void button1_Click(object sender, EventArgs e)
 {
 sayi = int.Parse(textBox1.Text);
 c = int.Parse(textBox3.Text);
 sonuc = sayi * c;
 textBox2.Text = sonuc.ToString();
}
//Bölme İşlemi
private void button2_Click(object sender, EventArgs e)
 {
 double bolum;
 sayi = int.Parse(textBox1.Text);
 c = int.Parse(textBox3.Text);
 bolum = sayi / c;
 textBox2.Text = bolum.ToString();
 }
//Çıkarma İşlemi
private void button3_Click(object sender, EventArgs e)
 {
 sayi = int.Parse(textBox1.Text);
 c = int.Parse(textBox3.Text);
 sonuc = sayi - c;
 textBox2.Text = sonuc.ToString();
 }
//Toplama İşlemi
private void button4_Click(object sender, EventArgs e)
 {
 sayi = int.Parse(textBox1.Text);
 c = int.Parse(textBox3.Text);
 sonuc = sayi + c;
 textBox2.Text = sonuc.ToString();
 }
//Mod Alma İşlemi
private void button5_Click(object sender, EventArgs e)
 {
 sayi = int.Parse(textBox1.Text);
 c = int.Parse(textBox3.Text);
 sonuc = sayi % c;
 textBox2.Text = sonuc.ToString();
 }
//Üs Alma İşlemi
private void button6_Click(object sender, EventArgs e)
 {
 sayi = int.Parse(textBox1.Text);
 c = int.Parse(textBox3.Text);
 sonuc = Math.Pow(sayi,c);
 textBox2.Text = sonuc.ToString();
 }
 }
}


Hiç yorum yok:

Yorum Gönder