repl.it
@MIhm7904/

ProblemSet7

Nodejs

Problem Set 7: Loops

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
//Write a program that prints numbers 1 - 50.  If the number is even print the word 'EVEN!' next to it.  If the number is odd print the word 'ODD!' next to it.

for (i = 1; i <= 50; i++)
if (i % 2 == 1){
  console.log(i + " ODD!")
}else{
  console.log(i + " EVEN!")
}