13 lines
132 B
Bash
Raw Permalink Normal View History

2025-01-17 10:49:39 +05:30
#!/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"