daily pastebin goal
0%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * Programming Quiz: JuliaJames (4-1)
  3.  */
  4.  
  5. var x = 1;
  6.  
  7. while (x <= 20) {
  8.     // check divisibility
  9.     // print Julia, James, or JuliaJames
  10.     // increment x
  11.     if (x % 3 === 0 && x % 5 === 0) {
  12.         console.log("JuliaJames");
  13.     }
  14.     else if (x % 3 === 0) {
  15.         console.log("Julia");
  16.     }
  17.     else if (x % 5 === 0) {
  18.         console.log("James");
  19.     }
  20.     else {
  21.         console.log(x);
  22.     }
  23.     x++;
  24. }
RAW Paste Data
Top