Guest User

Untitled

a guest
Dec 7th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment