print "Enter a number: ";
$n=<STDIN>;
$t=$n;
$f=1;
for($i=0;$i<$t;$i++)
{
$f=$f*$n;
$n=$n-1;
}
print "Factorial is $f\n";
$n=<STDIN>;
$t=$n;
$f=1;
for($i=0;$i<$t;$i++)
{
$f=$f*$n;
$n=$n-1;
}
print "Factorial is $f\n";
www.studycsengg.gq
Copyright © Study CS Engg 2015. All rights reserved. Designed By Templateism | MyBloggerLab
0 comments:
Post a Comment