Set 87 Practical Question

⭐ Q37 – JavaScript: Display Even Numbers From 1 to 50

Example Code (Read Only):


<!DOCTYPE html>
<html>
<head>
<title>Even Numbers</title>
</head>

<body>

<h2>Even Numbers (1–50)</h2>

<script>
for (let i = 1; i <= 50; i++) {
    if (i % 2 == 0) {
        document.write(i + "<br>");
    }
}
</script>

</body>
</html>

Write Your HTML / JavaScript Code