!/bin/bash echo "Enter a number" read n s=1 for((i=1;i<=n;i++)) do s=`expr $s \* $i` done echo "Factorial is $s"
No comments