Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

factorial of a number bash

read num
count=1
for((i=1;i<num+1;i++));
do
    count=$((count*i))
done
echo "Factorial is $count"
 
PREVIOUS NEXT
Tagged: #factorial #number #bash
ADD COMMENT
Topic
Name
3+2 =