For each number between 1 and 100...
If the number is odd, print it out. But if the number is even, print the word "Steven" instead.
When we run the program, we should see the following output:
1
Steven
3
Steven
5
Steven
...
97
Steven
99
Steven
The program needs to start at 1 (not 0) and the number 100 must be included - the last number should be 100, not 99.
I'm still learning Javascript, so my first instinct is to create an While Statement:
var Number
var Counter = 1;
While (Number == even
Number <= 100) {
print ("Steven");
} else {
print (Number);
Should this even be a while loop though? How can I fix this statement so that it prints out odd numbers and "Steven" in-place of even numbers?
Edit: Tried to run in JSFiddle but nothing happened.