We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Linux Shell
- Bash
- Comparing Numbers
- Discussions
Comparing Numbers
Comparing Numbers
Sort by
recency
|
255 Discussions
|
Please Login in order to post a comment
read X read Y if [ Y ]; then echo "X is less than Y" elif [ Y ]; then echo "X is greater than Y" else echo "X is equal to Y" fi
read X read Y
if [[ Y ]]; then echo "X is greater than Y" elif [[ Y ]]; then echo "X is less than Y" else echo "X is equal to Y" fi
!/bin/bash
read x read y if((x > y)); then echo "X is greater than Y" elif ((x < y)); then echo "X is less than Y" else echo "X is equal to Y" fi
read X read Y if ((X < Y)) then echo "X is less than Y" elif ((X > Y)) then echo "X is greater than Y" else echo "X is equal to Y" fi