code:-

echo "enter two numbers"
read a b

if(( $a % 2  == 0 ))
then
echo "even number $a"
elif(( $b % 2 == 0))
then
echo "even number $b "
elif(( $a % 2 ==0 && $b % 2 == 0 ))
then
echo "both are even"
else
echo "both are not even"
fi
output:-

enter two numbers
2 4
even number  2
even number 4
both are even

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post