Linux Shell Scripts To Check Odd Even Number Using IF Condition

Defination: Write a Shell Scripts For To Check Given Number Is Odd Or Even.

Source Code:

echo "Enter Any Number For Check Odd Or Even:->";
read no

if test `expr $no  % 2 ` -eq 0
then
    echo "This Number Is Even";
else
    echo "This Number Is Odd";
fi


Output:

Enter Any Number For Check Odd Or Even:-> 10

This Number Is Even


Explanation::

The Linux Shell Scripts is a Powerful Scripts For The Development in This program $no is a Variable for Get The Value from the user.
Linux Shell Scripts To Check Odd Even Number Using IF Condition Linux Shell Scripts To Check Odd Even Number Using IF Condition Reviewed by Unknown on 10:31:00 AM Rating: 5

No comments:

Powered by Blogger.