---
title: "What is a Factorial program in C#"  
description: "What is a Factorial program in C#"  
author: "Anonymous User"  
published: 2018-11-26  
updated: 2018-11-26  
canonical: https://www.mindstick.com/forum/34707/what-is-a-factorial-program-in-c-sharp  
category: "c#"  
tags: ["c#", "oops"]  
reading_time: 1 minute  

---

# What is a Factorial program in C#

Like -

4! = 4*3*2*1 = 24

6! = 6*5*4*3*2*1 = 720

## Replies

### Reply by Anonymous User

Factorial program in c#...

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");
        }
    }
}
```

![What is a Factorial program in C#](https://www.mindstick.com/mindstickforums/02a33455-3c46-4e07-9707-ca44c79c5a7a/images/29014631-4284-44fe-9ee7-2f92969d2ed3.png)

Thank You...!!


---

Original Source: https://www.mindstick.com/forum/34707/what-is-a-factorial-program-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
