Showing posts with label factorail program in C#. Show all posts
Showing posts with label factorail program in C#. Show all posts

Monday 3 February 2020

factorial program in C#

public long Factorial(int n)
{
  return n ==0 ?1: n*Factorial(n-1);
}

Example: if you put 5, then it will execute : 5*4*3*2*1 =120