Page 423 - Webapplication11_C11_Flipbook
P. 423
var age = parseInt(prompt("Enter the age of the student: "));
var marks = parseInt(prompt("Enter the marks of the student: "));
if(age > 18)
{
if(marks > 65)
{
document.write(name, " is selected for college");
}
else
{
document.write(name, " is not selected for college");
}
}
else
{
document.write(name, " is too young for college");
}
</script>
</body>
</html>
On running the program given on previous page, we get the following output:
Practical Work 421

