Write a script to enter marks of students (name as arguments and echo the division secured by student)?



echo "Enter marks obtained in 5 subjects"
read m1 m2 m3 m4 m5
per=`expr \( $m1 + $m2 + $m3 + $m4 + $m5 \) / 5`
if [ $per -ge 60 ]
then
echo "First division"
elif [ $per -ge 50 -a $per -le 60 ]
then
echo "Second division"
elif [ $per -ge 40 -a $per -le 50 ]
then
echo "Third division"
else
echo "Fail"
fi                                              


OUTPUT :

Enter marks obtained in 5 subjects
56        78       56       43       67

First division

Enter marks obtained in 5 subjects

56        50       40       8         9

Fail

Comments

Popular posts from this blog

Write a program to add two number using inline function in C++?

Traversing of elements program with algorithm and Flowchart