Skip to content

Instantly share code, notes, and snippets.

@claudiainbytes
Created August 21, 2017 21:18
Show Gist options
  • Save claudiainbytes/229d05241042c6c0affd3d5ab5360590 to your computer and use it in GitHub Desktop.
Save claudiainbytes/229d05241042c6c0affd3d5ab5360590 to your computer and use it in GitHub Desktop.
/*
* Programming Quiz: JuliaJames (4-1)
*/
var x = 1;
while ( x <= 20) {
// check divisibility
if(( x % 3 === 0 ) && ( x % 5 === 0)){
console.log("JuliaJames");
}else if ( x % 3 === 0) {
console.log("Julia");
} else if ( x % 5 === 0){
console.log("James");
} else {
console.log(x);
}
x++;
// print Julia, James, or JuliaJames
// increment x
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment