how to find even numbers?

I am trying to find even numbers from 0 to 100 but it is not working. even it not showing any error. can anyone help me to figure out?

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>        
var x = 1;
        while (x <= 100) {
            if (x % 2 == 0) {
                console.log(x);
            } else {
                break;
            }
            x++;
        }
    </script>
</body>

</html>

107 thoughts on “how to find even numbers?”

  1. I have been browsing on-line greater than 3 hours these days, yet I by no means discovered any fascinating article like
    yours. It’s beautiful value sufficient for me. In my view, if
    all site owners and bloggers made just right content material as you did,
    the internet will be much more helpful than ever before.

    Reply
  2. Wow, awesome weblog format! How lengthy have you ever been running a blog
    for? you make blogging look easy. The whole look of your site is excellent,
    let alone the content material!

    Reply
  3. Normally I don’t learn post on blogs, but I would like to say that this write-up very compelled me to take a look at and do it!

    Your writing style has been surprised me.

    Thank you, quite nice article.

    Reply

Leave a Comment