Factorial Programm In C#
C# :
Factorial
public void Fact()
{
int Factorial = 1;
//Value 5
int Fac = 5;
for (int i = 1; i <= Fac; i++)
{
Factorial = Factorial * i;
}
Response.Write("Factorial : ");
Response.Write(Factorial);
}
ANS:
Face = 5;
Factorial = 1*2*3*4*5
Factorial =120;
No comments:
Post a Comment