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;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (Convert.ToInt64(textBox1.Text) <= 0)
{
MessageBox.Show("You Can't Enter Number Less Than 1");
}
else
{
long n = Convert.ToInt64(textBox1.Text);
long fact=1;
for (int i = 1; i <= n; i++)
{
fact = fact * i;
}
label1.Text = Convert.ToString(fact);
}
}
}
}