Write a Shell Script to Check Whether Number is Even or Odd using if else?

Code:

echo "Enter any number"
read number
remainder=($number%2)
if [ $remainder -gt 0 ]
then
echo "The Number Is Even"
else
echo "The Number Is Odd"
fi

Post a Comment

0 Comments