Friday, October 17, 2014

Write A program to check grade using switch case using Javascript .


Write A program to check grade using switch case using Javascript .
Code : switch.html

<html>
<head>
<script type="text/javascript">
var grade=prompt("Enter grade",0);
switch(grade)
{
case 'A':
document.write("Distriction");
break;
case 'B':
document.write("First Class");
break;
case 'C':
document.write("Passed");
break;
case 'D':
document.write("Failed");
break;
default:
document.write("Unknown grade");
}
</script>
</head>
</html>

No comments: