
RecursionFactorial
By:
bsudhir6 on
May 15th, 2012 | syntax:
C# | size: 0.63 KB | hits: 21 | expires: Never
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RecursionFactorial
{
class Program
{
public static void Main(string[] args)
{
for (long counter = 1; counter <= 10; counter++)
Console.WriteLine("{0}! = {1}", counter, Factorial(counter));
}//end Main
public static long Factorial( long number){
if( number <= 1)
return 1;
else
return number * Factorial(number - 1);
}//end method Factorial
}//end class Program
}//end RecursionFactorial