Advertisement
Guest User

FizzBuzz.java

a guest
Jun 27th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. public class FizzBuzz{
  2. public static void main(String[] args){
  3. for (int i=0; i < 100; ++i){
  4. if (i%15 == 0){
  5. System.out.println("FizzBuzz");
  6. }else if (i % 3 == 0){
  7. System.out.println("Fizz");
  8. }else if (i % 5 == 0){
  9. System.out.println("Buzz");
  10. }else{
  11. System.out.println(i);
  12. }
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement