using System;
public class Program
{
public static void Main()
// We need this long integer to be able to store our answers:
long iAnswer=0;
// Create the function 'factorial' returning a lonng int and passing int an int as a parameter:
static long factorial(int i)
if(i<=1)
return 1; // This interrupts the function and causes a base return.
// If the parameter passed in is not small enough, call the funtion again with i-1 parameter:
return i * factorial(i-1);
}
// Do the following 20 times - find the factorials of 1 up to 20:
for(int j=1; j<21; j++)
iAnswer = factorial(j);
Console.WriteLine(iAnswer);