25.05.2012

Bash - odd or even


echo -n "Enter numnber : "
read n

rem=$(( $n % 2 ))

if [ $rem -eq 0 ]
then
  echo "$n is even number"
else
  echo "$n is odd number"
fi

Комментариев нет: