<?php for($i=1;$i<11;$i++) { $sum =1; for($j=1;$j<=$i;$j++) { $sum=$sum*$j; } echo "The factorial of $i is ".$sum."<br/>"; } ?>
No comments:
Post a Comment