Write a shell script to find the factorial of a given number using until loop.
Answers
Answered by
0
echo factorial of a number
echo Enter the number
read n
i=1
fact=1
while test $i -le $n
do
fact=`expr $fact \* $i`
i=`expr $i + 1`
done
echo The factorial of a number is $fact
Similar questions
History,
6 months ago
Environmental Sciences,
6 months ago
English,
6 months ago
Computer Science,
1 year ago