usingMaths.com
Demonstrating and showing pupils and students one application of Mathematics.







<< PreviousNext >>

Code for Listing Even Numbers in JavaScript



What are Even Numbers?

Hello pupils, what are even numbers? Even numbers are numbers that are divisible by 2.

They include:

2, 4, 6, 8, 10, 12, 14, 16, 18, 20, ...

Well then, let's see how we can write a programming code to make our computer list a set of even numbers in JavaScript, between a given range of values.

Type out the adjoining JavaScript code for listing even numbers.
We will see what each significant part does as we go along.


Creating HTML Files

Create a new file; On Notepad++: File, New.
Call it EvenNumbers.html.

Remember to select the right folder (usingMaths) if necessary and change Type to All.








<< PreviousNext >>