Professional Documents
Culture Documents
Exp2 B
Exp2 B
Exp2 B
*****Odd or Even*****
Enter a number : 33
45 is an Odd number
Enter a number : 18
18 is an Even number
EX.NO : 2.b) SHELL PROGRAMMING
Odd or Even
DATE :
AIM:
To write the simple shell programs by using conditional, branching and looping statements.
ALGORITHM:
while:
do
read –p “Enter a number : “ n
if [ $((n%2)) -eq 0 ]
then
echo “$n is an Even number”
else
echo “$n is an Odd number”
fi
done
RESULT :
Thus the program was Executed and Verified Successfully.