If Else If Statement tutorial in JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>If Else If Statement</title>
<script>
var per = 55;
if (per >= 80 && per <= 100) {
document.write("You are in Merit.");
}
else if (per >= 60 && per < 80) {
document.write("You are in 1st Division.");
}
else if (per >= 45 && per < 60) {
document.write("You are in 2nd Division.");
}
else if (per >= 33 && per < 45) {
document.write("You are in 3rd Division.");
}
else if (per < 33) {
document.write("You are Failed.");
}
else {
document.write("Please Enter Valid Percentage.");
}
</script>
</head>
<body>
</body>
</html>
.png)
.png)
.png)
.png)
Comments
Post a Comment