filmov
tv
Find a number is positive or negative using Shell Script #shellscripting #shorts #ytshorts #short
Показать описание
In this video we will learn to find a number is positive or negative
#!/bin/sh
echo "Enter a number"
read num
if [ $num -lt 0 ]
then
echo "$num is negative"
elif [ $num -gt 0 ]
then
echo "$num is positve"
else
echo "$num is zero"
fi
#!/bin/sh
echo "Enter a number"
read num
if [ $num -lt 0 ]
then
echo "$num is negative"
elif [ $num -gt 0 ]
then
echo "$num is positve"
else
echo "$num is zero"
fi