Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo -n "Enter a number: "
- read n
- small=$n
- large=$n
- for ((i=1; i<5; i++)){
- echo -n "Enter a number: "
- read n
- if [ $large -lt $n ]
- then
- large=$n
- fi
- if [ $small -gt $n ]
- then
- small=$n
- fi
- }
- echo "Smallest: $small"
- echo "Largest: $large"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement