ana sayfa > C# > C#’ta işlemler

C#’ta işlemler

Çarşamba, 28 Eki 2009 Tansu yorum ekle yorumlara git

C#’ta toplama, çıkarma, çarpma, bölme ve üs alma işlemleri

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace WindowsApplication3

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

textBox3.Text = Convert.ToString(Convert.ToInt32(textBox1.Text) + Convert.ToInt32(textBox2.Text));

}

private void button2_Click(object sender, EventArgs e)

{

textBox3.Text = Convert.ToString(Convert.ToInt32(textBox1.Text) – Convert.ToInt32(textBox2.Text));

}

private void button3_Click(object sender, EventArgs e)

{

textBox3.Text = Convert.ToString(Convert.ToInt32(textBox1.Text) * Convert.ToInt32(textBox2.Text));

}

private void button4_Click(object sender, EventArgs e)

{

textBox3.Text = Convert.ToString(Convert.ToDouble(textBox1.Text) / Convert.ToDouble(textBox2.Text));

}

private void button5_Click(object sender, EventArgs e)

{

int i, a, b, c = 1;

a = Convert.ToInt32(textBox1.Text);

b = Convert.ToInt32(textBox2.Text);

for (i = 1; i <= b; i++)

c = c * a;

textBox3.Text=Convert.ToString(c);

}

}

}

Bu kategorideki rastgele diğer yazılar
  • » C# ile Asal Sayılar
  • » C#'ta Hesap Makinesi
  • » C# Varmısın Yokmusun Programı
  • » Foreach Döngüsü [C#]
  • » C# If-Else & Switch-Case Yapısı
  • » Visual Studio Menüleri - File Menüsü [C#]
  • » Asansör Kontrol Programı [C#]
  • » C# Random koduyla iki sayı arasında sayı üret..
  • » C# 2-9 arası rakamlara bölünebilen sayılar(combobox)
  • » C#'ta Radio Button Kullanımı
  • » Karakter Sayısı [C#]
  • » c#'ta Celcius Ve Fahrenayt
  • » Q MATİK (BANKA SIRALAMA SİSTEMİ)
  • » For Döngüsü [C#]
  • » C#'ta ListBox Ve ComboBox Kullanımı
    1. Sefahat
      Çarşamba, 04 Kas 2009 zamanında 17:04 | #1

      Elıne Saglık Arkadasım…

    2. Tansu
      Cuma, 06 Kas 2009 zamanında 00:20 | #2

      Eyvallah arkadaşım ..

    3. Murat
      Perşembe, 26 Kas 2009 zamanında 19:49 | #3

      Açıklayıcı bir program olmuş. Teşekkür ederim.

    4. Tansu
      Perşembe, 26 Kas 2009 zamanında 21:01 | #4

      Bir şey değil.

    5. ayaz
      Cuma, 07 May 2010 zamanında 20:12 | #5

      xtBox3.Text = Convert.ToString(Convert.ToInt32(textBox1.Text) + Convert.ToInt32(textBox2.Text));

      Ohh dude i gotta say that was really short one.4 me done is done such bellow
      string firstnumber=textbox1.text;
      string secondnumber=textbox2.text;

      int sayi1;
      int sayi2;

      sayi1=convert.ToInt32(firstnumber);
      sayi2=convert.ToInt32(secondnumber);
      int combination=sayi1+sayi2;
      textbox3.text=combination.ToString();

    1. şimdilik geri bağlantı yok

    *
    Bu bir spamlara karşı koruma yazılımıdır, resimde gösterilen güvenlik kelimesi girilmelidir. Kelimeyi sesli duymak için resmi tıklayın
    Anti-spam kelimeyi duymak için tıklayın