Page 379 - Web Applications (803) Class 11
P. 379
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 377

