loader image

Shell script to find given number is even or odd

Linux shell program/script to find whether a given number is odd or even

echo "Enter a number : "
read n
rem=$(( $n % 2 ))
if [ $rem -eq 0 ]
then
echo "$n is even number"
else
echo "$n is odd number"
fi
Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
vishal

good

Last edited 2 years ago by vishal
Scroll to Top