Write a program to calculate the factorial of a number.
echo "Total no of factorial wants" read fact ans=1 counter=0 while [ $fact -ne $counter ] do counter=`expr $counter + 1` ans=`expr $ans \* $counter` done echo "Total of factorial is $ans" ------------------------------------------------------------------- output ------------------------------------------------------------------- Total no of factorial wants 5 Total of factorial is 120