Sha256: 340f49334ca0182eba66d735597c5429825461dffbdb88aaf10e5e6447c72162
Contents?: true
Size: 433 Bytes
Versions: 11
Compression:
Stored size: 433 Bytes
Contents
<?php function nfact($n) { if ($n == 0) { return 1; } else { return $n * nfact($n - 1); } } echo "\n\nPlease enter a whole number ... "; $num = trim(fgets(STDIN)); // ===== PROCESS - Determing the factorial of the input number ===== $output = "\n\nFactorial " . $num . " = " . nfact($num) . "\n\n"; echo $output; ?> <script> <?php echo ' '; ?> /*this is js <?php echo ':)'; ?> </script> not &js;
Version data entries
11 entries across 11 versions & 3 rubygems