How do you find the factorial of a number in a Bash script?

前端 未结 13 2117
别那么骄傲
别那么骄傲 2021-02-14 03:24

In shell scripting how to find factorial of a number?

相关标签:
13条回答
  • 2021-02-14 04:07
    echo Enter Number
    
    read num
    fact=1
    for ((i=1;i<=num;i++))
    do
    fact=$(($fact*$i))
    done
    echo $fact
    
    0 讨论(0)
提交回复
热议问题