Monday, October 4, 2010

RECURSIVE PROGRAM TO FIND THE FACTORIAL

public int Factorial(int x)
{
if (x == 1)
{
return x;
}
else
{
return x * Factorial(x - 1);
}
}

Bookmark and Share

No comments:

Post a Comment