Skip to content

Instantly share code, notes, and snippets.

@fhferreira
Last active December 27, 2015 13:39
Show Gist options
  • Select an option

  • Save fhferreira/7334546 to your computer and use it in GitHub Desktop.

Select an option

Save fhferreira/7334546 to your computer and use it in GitHub Desktop.
DevBus
dev = 0;
bus = 0;
devbus = 0;
for(i=1;i<101;i++){
if(i%3 == 0 && i%5 == 0){
document.write( i + ' - devbus<br/>');
devbus++;
}
if(i%3 == 0){
document.write( i + ' - dev<br/>');
dev++;
}
if(i%5 == 0){
document.write( i + ' - bus<br/>');
bus++;
}
}
document.write('dev:' + dev + "<br/>");
document.write('bus:' + bus + "<br/>");
document.write('devbus:' + devbus + "<br/>");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment