The factorial is normally used in Combinations and Permutations (mathematics).
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication28
{
class Program
{
static void Main(string[] args)
{
int i, fact = 1, number;
Console.Write(" Enter any Number: ");
number = int.Parse(Console.ReadLine());
for (i = 1; i <= number; i++)
{
fact = fact * i;
}
Console.Write("\n Factorial of " + number + " is: " + fact);
Console.WriteLine("\n");
}
}
}
Thank You...!!
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Factorial program in c#...
The factorial is normally used in Combinations and Permutations (mathematics).
Thank You...!!