Saturday, June 9, 2018

SHELL SCRIPT TO CALCULATE GRADE OF A STUDENT

echo "Enter the marks"
read m
if [ $m -ge 80 ]
then
echo "AA"
elif [ $m -ge 70 ]
then
echo "A+"
elif [ $m -ge 60 ]
then
echo "A"
elif [ $m -ge 50 ]
then
echo "B+"
elif [ $m -ge 45 ]
then
echo "B"
elif [ $m -ge 35 ]
then
echo "C"
else
echo "D"
fi

                                            OUTPUT

biswarup@biswarup-desktop:~$ sh
$ sh grade.sh
Enter the marks
65
A
$

No comments:

Post a Comment