mirror of
https://github.com/autistic-symposium/shell-whiz-toolkit.git
synced 2025-05-11 03:05:41 -04:00
18 lines
No EOL
196 B
Bash
Executable file
18 lines
No EOL
196 B
Bash
Executable file
#! /bin/bash
|
|
|
|
n=0
|
|
on=0
|
|
fact=1
|
|
|
|
echo -n "Enter number to find factorial : "
|
|
read n
|
|
|
|
on=$n
|
|
|
|
while [ $n -ge 1 ]
|
|
do
|
|
fact=`expr $fact \* $n`
|
|
n=`expr $n - 1`
|
|
done
|
|
|
|
echo "Factorial for $on is $fact" |