// Faktöryel Hesaplama | www.aliakyildirim.com | Ali AKYILDIRIM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
// Faktöryel Hesaplama | www.aliakyildirim.com | Ali AKYILDIRIM
namespace Faktoryel
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
long sayi;
long sonuc;
private void btnHesapla_Click(object sender, EventArgs e)
{
try
{
sonuc = 1;
sayi = byte.Parse(txtSayi.Text);
for (long i = 1; i
{
sonuc = (sonuc * i);
} lblSonuc.Text = sayi + " ! = " + sonuc.ToString();
txtSayi.Focus();
}
catch (Exception)
{
MessageBox.Show("Lütfen Veriyi Rakamsal Olarak Girin..!", "Bilgi:");
}
}
private void btnYenile_Click(object sender, EventArgs e)
{
txtSayi.Text = string.Empty;
lblSonuc.Text = string.Empty;
txtSayi.Focus();
}
private void Form1_Load(object sender, EventArgs e)
{
txtSayi.Focus();
}
}
}
// Faktöryel Hesaplama | www.aliakyildirim.com | Ali AKYILDIRIM