Write a JavaScript program to display grade of a student. here we are using else-if ladder construct.
<html>
<head>
<title>Find grade of student</title>
</head>
<body>
<script type="text/javascript">
var marks;
marks = 78;
if(marks >= 75)
{
document.write("You have got Distinction");
}
else if(marks >=60 )
{
document.write("You have got First Class");
}
else if(marks >=50 )
{
document.write("You have got Second Class");
}
else if(marks >=40 )
{
document.write("You are passed");
}
else
{
document.write("You are failed");
}
</script>
</body>
</html>
