<script>
//percentage student
var per = parseInt(prompt("give value here"));
if( per>=80 && per<=100){
document.write("<h1> <br/>your grade is A+")
}
else if( per>=70 && per<=80){
document.write("<h1> <br/>your grade is Only A")
}
else if( per>=60 && per<=70){
document.write("<h1> <br/>your grade is Only B")
}
else if( per>=50 && per<=60){
document.write("<h1> <br/>your grade is Only C")
}
else if( per>=45 && per<=50){
document.write("<h1> <br/>your grade is Only Passed")
}
else if( per<33){
document.write("<h1> <br/>your are Fail")
}
else {
document.write("<h1> <br/>Your value is Invalid")
}
</script>
Even odd number check with the help of if else
var a = Number( prompt("Type here"));
//Numbre function is use to dicleration of number in prompte because of prompt is default string)
//prompt is default text or string
/*syntax of if else is : type if (condition ) {
argument }
true your condition return if argument
after that
else {
argument
}
on false else argument returen
*/
if (a%2 ===0){document.write("this is your even number ");
}
else{
document.write("this is odd number ");
}
// we check type only number not string or text use following
0 Comments:
Post a Comment