Social Icons

Wednesday 1 May 2013

Shell Programming [If- Else]


#!/bin/sh
echo -n "Enter how many times you want to enter  :  "
read d
for((i=0;i<d;i++))
do
echo -n "Enter your age :  "
read n
if [ $n -gt 20 ] && [ $n -lt 50 ]
then
echo "...........you are middle aged men...................... "
elif [ $n -gt 5 ] && [ $n -lt 20 ]
then
echo "................you r a boy................"
else
 echo ".............you are a old man ............. "
fi
done
exit 0

Output:

No comments:

Post a Comment

 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management