using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class CalcAvgPerc
{
static void Main(string[] args)
{
int i, fact = 1, n;
Console.WriteLine("Enter the number to calculate factorial...");
n = int.Parse(Console.ReadLine());
Console.WriteLine("Calculating...");
System.Threading.Thread.Sleep(1000);
for (i = 1; i <= n; i++)
fact = fact * i;
Console.WriteLine("Factorial for number {0} is {1}", n, fact);
Console.ReadKey();
}
}
}This program for Calculate the Factorial of a number in C#.
