Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Web Systems and Technologies

BSIT 605

HTML + Internal JavaScript


<!DOCTYPE html>

<html>

<head>

</head>

<body>

<!DOCTYPE html>

<html>

<head>

<body>

<center>

<div id="output"></div>

<script>

var Age = parseInt(prompt("Please enter your age:"));

if (Age >= 25) {

document.write("You are " + Age + "years old.<br>");

} else {

document.write("You are under 25 years old.<br>");

var Age = parseFloat(prompt("Enter a number:"));

if (Age < 100) {

document.write("You entered a number less than 100.<br>");

} else {
document.write("You entered a numbrt greater than 100.<br>");

document.write("<br>Print numbers 0-30<br>");

for (let a = 0; a <= 30; a++) {

document.write(a + "<br>");

document.write("<br>Print even numbers from 0-40<br>");

for (let b = 0; b <= 40; b += 2) {

document.write(b + "<br>");

document.write("<br>Print numbers that are multiples of 3 from 40 to 10 in


descending order<br>");

for (let c = 40; c >= 10; c--) {

if (c % 3 === 0) {

document.write(c + "<br>");

</script>

</center>

</body>

</html>

</html>

You might also like