Skip to content

Commit bd00cc8

Browse files
Create Factorial_Finder.sh
1 parent ae6d968 commit bd00cc8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Factorial_Finder.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
echo -n "Enter number: "
3+
read -r a
4+
fact=1
5+
while [ "$a" -ne 0 ]; do
6+
fact=$((fact * a))
7+
a=$((a - 1))
8+
done
9+
echo $fact

0 commit comments

Comments
 (0)