Created
December 7, 2018 17:34
-
-
Save masterfermin02/469e80c7ad59b49184230ed5c98e9c17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function print_numbers() | |
{ | |
for(var i = 1; i <= 200; i++) | |
{ | |
var str = ""; | |
if(i % 3 == 0) | |
{ | |
str = " Blue"; | |
} | |
if(i % 5 == 0) | |
{ | |
str += " Red"; | |
} | |
console.log(i + str); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function print_numbers(number) | |
{ | |
if(number < 1) return; | |
var str = ""; | |
if(number % 3 == 0) str = "Blue"; | |
if(number % 5 == 0) str += "Red"; | |
print_numbers(number - 1); | |
console.log(number +" "+ str); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment