<?php class Factorial { public function calculate ($int) { if (!is_int($int)) { echo "entry is not a number"; } $intStep = $int - 1; do { $int += $intStep; $intStep--; } while ($intStep > 0); return $int; } } $factorial = new Factorial; echo $factorial->calculate(5);
You have javascript disabled. You will not be able to edit any code.