Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Programming Quiz: JuliaJames (4-1)
- */
- var x = 1;
- while (x <= 20) {
- // check divisibility
- // print Julia, James, or JuliaJames
- // increment x
- 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++;
- }
Add Comment
Please, Sign In to add comment