function factorial(x)
{
 if (x<=1)
   return 1;
 else
 { if (x>1)
{temp = factorial(x-1);
     return x*temp;
   }
 }
}

