Using JavaScript print even numbers from 2 to 100

by Gaurav kondke

HTML CSS Tailwind CSS
This project is a simple JavaScript application developed using HTML and JavaScript to print even numbers from 2 to 100 using a for loop The main purpose of this project is to understand the basic concepts of programming logic loop structures variable initialization conditions and increment operations The webpage uses a clean and minimal HTML structure without unnecessary styling or graphical elements to focus on the JavaScript functionality The JavaScript code begins by initializing a variable named a with the value 2 The for loop continues executing as long as the value of a is less than or equal to 100 During each iteration the value of a increases by 2 which ensures that only even numbers are generated The console log method is used inside the loop to display each even number in the browser developer console This approach demonstrates how loops can automate repetitive tasks and reduce the need for writing multiple statements manually The project helped improve my understanding of JavaScript syntax control flow statements variables conditions and increment operators It also provided practical experience in writing simple algorithms and executing JavaScript code within an HTML document This project serves as a foundation for learning more advanced programming concepts and developing logical thinking skills
← Back to Gaurav kondke
Ready to build, learn, or ship?

Join 500+ students and businesses who trust Versatile Technology
for education, development, and cybersecurity.