Variables Multiplication for the factorial calculation
The main problem is that you never initialize result
(to 1
), so this:
result=$(($result * $input))
is equivalent to this:
result=$(( * $input))
which is not a valid arithmetic expression.
The main problem is that you never initialize result
(to 1
), so this:
result=$(($result * $input))
is equivalent to this:
result=$(( * $input))
which is not a valid arithmetic expression.