Skip to content

Commit a0017f2

Browse files
Add files via upload
1 parent 6a3541b commit a0017f2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
factorial()
2+
{
3+
p=1
4+
i=1
5+
while [ $i -le $x ]
6+
do
7+
p=$((p * i))
8+
i=$((i + 1))
9+
done
10+
}
11+
12+
echo "Enter the Number"
13+
read x
14+
factorial $x
15+
echo "The Factorial of "$x" is "$p

0 commit comments

Comments
 (0)