If Ladder :
In multiple if every if is independent ( if true stop)
In Else if every if is dependent ( if false continue next )
<script>
per=47.90;
if(per>=75)
document.write("A Grade");
else if(per>=60)
document.write("B Grade");
else if(per>=45)
document.write("C Grade");
else
document.write("D Grade");
</script>
In multiple if every if is independent ( if true stop)
In Else if every if is dependent ( if false continue next )
<script>
per=47.90;
if(per>=75)
document.write("A Grade");
else if(per>=60)
document.write("B Grade");
else if(per>=45)
document.write("C Grade");
else
document.write("D Grade");
</script>
No comments:
Post a Comment