13 lines
132 B
Bash
13 lines
132 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
echo "Enter a number"
|
||
|
read no
|
||
|
|
||
|
fact=1
|
||
|
|
||
|
for((i=1;i <= no; i++));do
|
||
|
fact=$((fact*i))
|
||
|
done
|
||
|
|
||
|
echo "The factorial is $fact"
|