eXorithm – Execute Algorithm: View / Run Algorithm factorial

Logo Beta

function factorial ($number

{

  $factorial = 1;

  while$number > 1)

  {

    $factorial *= $number

    $number--;

  }

  return $factorial