Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. // CODE CHALLENGE:
  2. // Fizz buzz: print 1 to 1000, but replace every multiple of
  3. // 3 with "fizz", every multiple of 5 with "buzz",
  4. // and any multiple of 3 AND 5 with "fizzbuzz"
  5.  
  6. // TO RUN THE CODE:
  7. // Copy-paste it into something like REPL.it and test it =P
  8.  
  9. // in JavaScript:
  10.  
  11.  
  12. for(var count=1; count<1000; count++) {
  13. var output = "";
  14. if (count % 3 === 0) {
  15. output = "fizz";
  16. } else if (count % 5 === 0) {
  17. output = "buzz";
  18. } else if (count % 5 === 0 && count % 3 === 0) {
  19. console.log("fizzbuzz");
  20. } else {
  21. console.log(count);
  22. }
  23. }
  24.  
  25. //java
  26. for(counter=1; counter<1000;counter++{
  27. if (counter%3==0 &&counter%5!=0)
  28.  
  29. })
  30.  
  31.  
  32.  
  33.  
  34. {% for i in superheroes %}
  35. {{superheroes}}
  36. {% endfor %}}
  37.  
  38. count = 1
  39. while count
  40.  
  41. String a;
  42. String b;
  43. String c;
  44. int a;
  45.  
  46. for()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement