Created
September 26, 2018 08:24
-
-
Save MirzaChilman/708e179264dfa70a5712032eefd7f797 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/tabebub
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
function tokped(i) { | |
const text1 = 'Codility' | |
const text2 = 'Test' | |
const text3 = 'Coders' | |
for(let n=1; n< i;n++){ | |
if(n % 5 === 0 && n % 3 === 0 && n % 2 === 0 ){ | |
console.log(text1+text2+text3) | |
}else if(n % 5 === 0 && n % 3 === 0){ | |
console.log(text2+text3) | |
}else if(n%3 === 0 && n%2 === 0){ | |
console.log(text1+text2) | |
}else if(n%2 === 0 && n%5 === 0){ | |
console.log(text1+text3) | |
}else if(n % 2 === 0){ | |
console.log(text1) | |
}else if(n % 3 === 0){ | |
console.log(text2) | |
}else if(n % 5 === 0){ | |
console.log(text3) | |
}else { | |
console.log(n) | |
} | |
} | |
} | |
tokped(24) | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">function tokped(i) { | |
const text1 = 'Codility' | |
const text2 = 'Test' | |
const text3 = 'Coders' | |
for(let n=1; n< i;n++){ | |
if(n % 5 === 0 && n % 3 === 0 && n % 2 === 0 ){ | |
console.log(text1+text2+text3) | |
}else if(n % 5 === 0 && n % 3 === 0){ | |
console.log(text2+text3) | |
}else if(n%3 === 0 && n%2 === 0){ | |
console.log(text1+text2) | |
}else if(n%2 === 0 && n%5 === 0){ | |
console.log(text1+text3) | |
}else if(n % 2 === 0){ | |
console.log(text1) | |
}else if(n % 3 === 0){ | |
console.log(text2) | |
}else if(n % 5 === 0){ | |
console.log(text3) | |
}else { | |
console.log(n) | |
} | |
} | |
} | |
tokped(24) | |
</script></body> | |
</html> |
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 tokped(i) { | |
const text1 = 'Codility' | |
const text2 = 'Test' | |
const text3 = 'Coders' | |
for(let n=1; n< i;n++){ | |
if(n % 5 === 0 && n % 3 === 0 && n % 2 === 0 ){ | |
console.log(text1+text2+text3) | |
}else if(n % 5 === 0 && n % 3 === 0){ | |
console.log(text2+text3) | |
}else if(n%3 === 0 && n%2 === 0){ | |
console.log(text1+text2) | |
}else if(n%2 === 0 && n%5 === 0){ | |
console.log(text1+text3) | |
}else if(n % 2 === 0){ | |
console.log(text1) | |
}else if(n % 3 === 0){ | |
console.log(text2) | |
}else if(n % 5 === 0){ | |
console.log(text3) | |
}else { | |
console.log(n) | |
} | |
} | |
} | |
tokped(24) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment