Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // Trey Darling
  2. package oct4;
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class FizzBuzz {
  7.  
  8. public static void main(String[] args) {
  9. Scanner input = new Scanner(System.in);
  10. System.out.print("Enter an integer: ");
  11. int x = input.nextInt();
  12. if (x % 15 == 0)
  13. System.out.println("FizzBuzz");
  14. else if (x % 5 == 0)
  15. System.out.println("Buzz");
  16. else if (x % 3 == 0)
  17. System.out.println("Fizz");
  18. else
  19. System.out.println(x);
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement