Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Trey Darling
- package oct4;
- import java.util.Scanner;
- public class FizzBuzz {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Enter an integer: ");
- int x = input.nextInt();
- if (x % 15 == 0)
- System.out.println("FizzBuzz");
- else if (x % 5 == 0)
- System.out.println("Buzz");
- else if (x % 3 == 0)
- System.out.println("Fizz");
- else
- System.out.println(x);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement