Last active
January 20, 2022 04:28
-
-
Save bryancodesjs/e014057f8f1d14a12ca084f565da6339 to your computer and use it in GitHub Desktop.
Count from 1 to 100 and print a message every time a multiple of 3 or 5 is found.
This file contains 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 findMultiples() { | |
let baseNumer = 0; | |
for(let i = 0; i<100 ; i++) { | |
baseNumer ++; | |
console.log(baseNumer); | |
if(baseNumer % 3 == 0) { | |
console.log('multiple of 3 found'); | |
} else { | |
if (baseNumer % 5 == 0) { | |
console.log('multiple of 5 found'); | |
} | |
} | |
} | |
} | |
findMultiples(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment