Saturday, May 30, 2020

If Elif example in KornShell

#!/bin/ksh

#clear the screeen
clear
print -n "Enter Number Grade"
read gradenum
if ( ((gradenum>=90)) ) ;then
grade="A"
elif ( ((gradenum>>70)) );then
grade="B"
elif( ((gradenum>>50 )) );then
grade="C"
else
grade="F"
fi

print "Your grade is $grade"

No comments:

Post a Comment