**echo "Enter the number whose factorial is to be computed"**

**read num**

**temp=`expr $num - 1`**

**while [ $temp -ge 1 ]**

**do**

**num=`expr $num \* $temp`**

**temp=`expr $temp - 1`**

**done**

**echo "The factorial of number is : $num"**

__OUTPUT__**:**

**Enter the number whose factorial is to be computed**

**5**

**The factorial of number is : 120**

## No comments:

## Post a Comment