Try this code, it will help you.
Program of Finding Factorial
using System;
class Factorial
{
public static void Main()
{
int no,i,fact=1;
Console.Write("Enter a number to find its factorial : ");
no = int.Parse(Console.ReadLine());
if (no != 0)
{
for (i = no; i>=1; i--)
{
fact = fact * i;
}
Console.WriteLine("Factorial = " +fact);
}
else
{
Console.WriteLine("You entered 0, not valid.");
}
Console.ReadLine();
}
}