Write a javascript code for find grade to the given marks(numbers)

Example :- write a javascript code for the following conditions-

© Grade of 90 and above to 90's is an'A'
©Grade of 80 t0 89 is 'B'
©Grade of 70 t0 79 is 'C'
©Grade of 60 t0 69 is 'D'
©Grade of 59 t0 bilowi 'F'





<!DOCTYPE html>
<html>
<head>
<script language="javascript">
var g ;
g=prompt("Input your Hindi marks");
if(g>90 || g==90)
{
alert ("Garde 'A' ");
}
else if(g>=80 && g<=89)
{
alert ("Garde 'B' ");
}

else if(g>=70 && g<=79)
{
alert ("Garde 'C' ");
}

else if(g>=60 && g<=69)
{
alert ("Garde 'D' ");
}

else if(g==59 || g<59)
{
alert ("Garde 'F' ");
}
</script>
</head>
</html>

1 comment: