Answers for "write a program in shell script to find factorial of a number"

-1

write a program in shell script to find factorial of a number

#Bash script to find factorial of a number
echo -n "Enter a number: "
read number
factorial=1
for(( i=1; i<=number; i++ ))
do
  factorial=$[ $factorial * $i ]
done
echo "The factorial of $number is $factorial"
Posted by: Guest on October-06-2020

Code answers related to "write a program in shell script to find factorial of a number"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language