Lab 9: Praogram to find the grade of the student depending upon scored marks

echo "Enter the name of the student"
read name
echo "Enter the marks of three subjets"
read subject1
read subject2
read subject3
totalmarks=`expr $subject1 + $subject2 + $subject3`
average=`expr $totalmarks / 3`
if [ $average -ge 60 ]
then
    echo "$name got $average % First CLass"
    elif [ $average -ge 40 ]
    then
        echo " $name got $average % second class"
            elif [ $average -ge 35 ]
            then
                echo "$name Got $average% third class"
            else
                echo "$name got $average% Failed"
fi

No comments

Powered by Blogger.