Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- factorial ()
- {
- if (( $1 == 1)) ; then
- echo 1
- else
- echo $(( $1* $(factorial $(($1-1))) ))
- fi
- }
- factorial $1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement