11 Mayıs 2012 Cuma

KLAVYEDEN GİRİLEN SAYININ KAREKÖK VE FAKTÖRİYELİNİ BULAN PROGRAM



public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
lblFaktoriyel.Text = "";
lblKarekok.Text = "";
}
private void btnHesapla_Click(object sender, EventArgs e)
{
double sayi = Convert.ToDouble(txtSayi.Text);
double sonuc=0;
sonuc = Math.Sqrt(sayi);
lblKarekok.Text="Girilen Sayının Karekökü: "+sonuc.ToString();
for (double i = sayi; i > 1; i--)
{
sonuc = sonuc * i;
}
lblFaktoriyel.Text = "Girilen Sayının Faktöriyeli: "+sonuc.ToString();
}

Hiç yorum yok:

Yorum Gönder