Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- echo -n "Enter the limit: "
- read n
- if [ $n -lt 0 ]; then
- echo "Not allowed"
- else
- ans=1
- for(( i=2; i<=$n; i++ )){
- let ans*=$i
- }
- echo $ans
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement