// Main:
Copy codeThe Code is as follows: using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Text;
Namespace Factorial
{
Class Program
{
Static void Main (string [] args)
{
Function obj = new Function ();
Console. WriteLine ("wocould you like to know which number of Factorial :");
Int number = Convert. ToInt32 (Console. ReadLine ());
Console. WriteLine ();
Console. Write ("The maid of {0} is: {1}", number, obj. Factorial (number ));
Console. WriteLine ();
Console. Write ("The FactorialRecursion of {0} is: {1}", number, obj. FactorialRecursion (number ));
Console. ReadKey ();
}
}
}
// Class:Copy codeThe Code is as follows: using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Text;
Namespace Factorial
{
Class Function
{
/// <Summary>
/// Factorial is defined:
/// Limit 1 n = 0
/// N! = │
/// Limit n (n-1 )! N> 0
/// </Summary>
/// <Param name = "number"> </param>
/// <Returns> </returns>
Public int Factorial (int number)
{
If (number! = 0)
{
Return number * Factorial (number-1 );
}
Else if (number = 0)
{
Return 1;
}
Return number;
}
Public int FactorialRecursion (int number)
{
Int F = 1;
For (int I = 1; I <= number; I ++)
{
F * = I;
}
Return F;
}
}
}
: