# File: fact.pl # Title: FACTORIAL n!! # Input from keyboard an integer # find factorial # Do this until you want to. Continue(y/n)? = # Author: MM # Input number? 5 # Result: 5! = 120 # Continue(y/n)? n # Bye $yesorno = "y"; while($yesorno eq "y") { print "Input number? "; $n = ; chop($n); $r = 1; for $i (1..$n) { $r = $r * $i; } print "Result: $n ! = $r"; print "\nContinue(y/n)?= "; $yesorno = ; chop($yesorno); } print "Bye"; exit;