Write a c# program to print factorial of a number


using System;

public class Factorial
{
    public static void Main(string[] args)
    {
        int number = 5;
        int factorial = 1;

        for (int i = 1; i <= number; i++)
        {
            factorial *= i;
        }

        Console.WriteLine("The factorial of {0} is: {1}", number, factorial);
    }
}
Write a c# program to print factorial of a number Write a c# program to print factorial of a number Reviewed by Bhaumik Patel on 11:45 PM Rating: 5